Learn about the different Execution Modes (Callable and RunAlways) that charts can run in as well as options (Persist State and Hot Editable) and events scripts (On Start, On Stop, On Cancel, and On Abort) that are attached to the chart.

Video recorded using: Ignition 7.9


(open in window)

[00:00] In this lesson, we're going to look at the properties of a chart itself. When you open up a chart, you can click on the empty space in the background and the element properties editor will switch to editing the properties of the chart itself. Anytime you're editing a chart, you can just go ahead and click right on the background, and get back to those chart properties. The first setting to look at is the execution mode of the chart. By default, all charts start in callable execution mode. callable execution mode means that any number of instances of the chart can be executed or called from anywhere, you might have zero incidences running rate might have a 100 incidences running of your chart. The run always mode means that the ignition system itself is going to automatically start a single instance of your chart, and the idea here is that you always just want one instance of a chart running. So for example, if I take this chart and switch it to run always mode, you noticed that when it was in callable mode, I had no instances running, but if I save it and run always mode, the system's going to go ahead and start up one instance, and if I try to start another instance, it'll tell me I can't because it's in run always mode. So whenever you start up a gateway, it is going to start an instance of all of it run always charts. But it's up to you to design the chart to stay running. So for example, if I had a chart this chart is designed to stay running forever, it just will loop around here forever. But if I had a chart that had an end step on it, and the chart reached the end step, the instance would stop, and the system's not going to start another instance for you. So it's up to you to design a chart that just runs continually. And the last execution mode is disabled, which means that no instances of that chart are going to be able to be started. The next properties here to talk about our persist state and hot editable. Persist state means that the gateway is going to, upon shut down, pause all of the charts that are in persist state mode, and then remember what they were doing, save the state of the chart to a file on disk, so that when the gateway starts back up, it can try and start up all of those instances where they had left off. Now in order for this to work well, you need to design your charts to be responsive, which is something we're going to cover in a later lesson about chart best practices. It's also important to understand that by having persist state checked, I mean, your obviously your chart isn't going to be running when the gateway is stopped, it's going to be paused and then when the gateway is started again, it will be resumed. Also, if the gateway stops for an unexpected reason like a power loss, it's not going to record the state in that case. So, if you need a chart that's going to be running across unexpected shutdowns, you're going to want to set up a redundant system. The hot editable feature is used to be able to make changes to chart instances after they've already started running. Now, you'll see here in the tool tip that it specifies that non structural changes will be applied. And what that means is basically any changes that you make to the configuration of an element that's a non structural change, anything you do like dragging an element around or adding new elements or reconfiguring the structure of a chart, that's a structural change. So if you have an instance of a chart running, and you, for example, make a change to the source of a transition condition. Then, if you save that, and there are running instances those changes will be applied to the running instances. But if you make a structural change, it won't be able to apply those changes to the running instances, and so the instances will just continue running, using whatever configuration they had. Lastly, we have the event scripts. So these are scripts that are specified on the chart that can respond to changes in the chart life cycle. So we have a non start script that of course runs when the charts started. On stop, is run when the chart stops, which means it has reached an end step. We have on cancel, which is going to be called when the chart is canceled, for example, if somebody were to click here and then choose the cancel option, the on cancel event would be invoked, and last we have on abort, on abort is a script that is called if there's an unexpected error somewhere else in chart execution. And in this script, you will see that there is a new variable in your chart scope called abort cause and that's going to be the exception that caused the chart to abort. So, using this system, using this event you can detect why the chart aborted.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.


Share this video