SFC Elements ‘Step’ and ‘Transition’¶
Step symbol ; Transition symbol
As a rule, CODESYS inserts steps and transitions as combinations. Inserting a step without a transition or a transition without a step causes an error when compiling. You can modify this by double-clicking the name.
Attention
Step names must be unique within the scope of the parent block. Consider this especially when using actions that were also programmed in SFC.
Please note that you can convert a step into an initial step by clicking Init step or by setting the respective property in the SFC properties.
All steps are defined by the step properties, which you can display and edit in the Properties view, depending on the set options.
You have to add those actions to the step which are to be executed when the step is active. A distinction is made between IEC actions and step actions. Details for this are found in the chapter about the SFC element “Action”.
A transition must include the condition for the subsequent step to be active as soon as the value of the condition yields TRUE
. Therefore, a transition condition must yield TRUE
or FALSE
. It can be defined in one of two ways:
- Inline condition (direct): You replace the default transition name with either the name of a Boolean variable, a Boolean address, a Boolean constant, or a statement with a Boolean result, for example
(i<100) AND b
. You cannot specify programs, function blocks, or assignments here.
- Inline condition (direct): You replace the default transition name with either the name of a Boolean variable, a Boolean address, a Boolean constant, or a statement with a Boolean result, for example
- Multi-use condition (separate transition or property object): You replace the default transition name with the name of a transition or property object (
,
). You create these objects by clicking . This allows multiple use of transitions, for example “condition_xy” in the figures below. Like an inline condition, the object can contain a Boolean variable, Boolean address, Boolean constant, or an statement with a Boolean result. In addition, it can also contain multiple statements with any code.
- Multi-use condition (separate transition or property object): You replace the default transition name with the name of a transition or property object (
Attention
The user is responsible for assigning the required expression to a transition variable if the transition includes multiple instructions.
Transitions that reference a transition or property object are marked with a small triangle in the upper right corner of the transition box.
As opposed to CoDeSys V2.3, now CODESYS treats a transition condition like a method call. The entry has the following syntax:
<transition name>:=<transition condition>
(for example trans1:= a=100
)
or only
<transition condition>
(for example a=100
)
You will find an example (condition_xy) in the figure above.
See also