SFC Elements ‘Step’ and ‘Transition’

Step symbol 369ae1d6f2a9b5cfc0a8640e0171849c_422c5724f339fca1c0a8640e014462ed ; Transition symbol 369ae1d6f2a9b5cfc0a8640e0171849c_aa9e1c84f340d9f6c0a8640e013ea35d

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.

../_images/56dec285f34c4742c0a8640e01e3ee02

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:

    1. 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.
    1. Multi-use condition (separate transition or property object): You replace the default transition name with the name of a transition or property object ( 369ae1d6f2a9b5cfc0a8640e0171849c_803dec3511148cd1c0a8640e0135e826 , 369ae1d6f2a9b5cfc0a8640e0171849c_bb8da31a11139f32c0a8640e00602fd3 ). You create these objects by clicking Project ‣ Add Object. 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.
../_images/08bb9eedf369fceec0a8640e01ff1e13

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.

../_images/d7fba9fdf376f0bbc0a8640e00314b04

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