Online Mode
The behavior of Statechart objects in online mode corresponds to the normal online behavior in TwinCAT 3. As usual it is possible to monitor a loaded application, write or force variables, set breakpoints or process a program in single cycles.
In online mode an active state is shown in blue, an active composite state in light blue. In online mode the value of a transition expression is displayed next to the transition. If the transition consists of only one transition variable, the value of the variable can be changed for writing or forcing by double-clicking on the monitoring value. If a value has been prepared for writing or forcing, this is indicated in the top right corner of the monitoring area (see the monitoring field of the transition variable bLeaveState4 in the center of right-hand edge in the image below: the blue corner indicates that the variable value TRUE is ready for writing or forcing).
An additional debugging option is provided by transferring the variables of a transition to the watch list via a command. To this end select Add Watch from the context menu of the transition. This command is particularly useful if a transition expression consists of a combination of several variables (e.g. "bCondition1 AND bCondition2"). If you execute the command Add Watch for this transition, both variables of the transition expression are added to the watch list, i.e. bCondition1 and bCondition2. This gives you a simple overview of which sub-signal of the overall expression does not yet have the required value for switching to the next state.
Furthermore, the commands Go To Definition and Find All References are supported for transitions.
All possible positions for breakpoints are shown as white circles with grey edge in the Statechart. To set a breakpoint, select a circle. The circle is highlighted in grey: .
Select Debug > Toggle Breakpoint or press [F9]. The program stops at the breakpoint, and the point is highlighted in yellow in the Statechart.
Online Change
Offline edits to an existing Statechart can usually be loaded to the controller with an online change without re-initializing the chart if you change transitions, conditions, priorities, actions or names. The state that was active before the online change is thus still active after the online change.
However, in the case of an online change the Statechart is always restarted –i.e. the start state is activated –if a state or a region is added, removed or replaced. This also applies to implicit states such as the "Selection" element, or to the property for making a Statechart "abortable".