Macro Step

Macro steps are used for calling macro sections and thus for hierarchical structuring of sequential controls.

Representation of a Macro Step:

Macro steps have the following properties:

  • Macro steps can be positioned in "Sequence Control" sections and in macro sections.

  • The number of macro steps is unlimited.

  • The nesting depth, i.e. macro steps within macro steps is to 8 levels.

  • Each macro step is implicitly allocated a variable of data type SFCSTEP_STATE, see SFCSTEP_STATE Variable.

  • Macro steps can be allocated a variable of data type SFCSTEP_TIMES, see SFCSTEP_TIMES Variable.

  • Macro steps can NOT be allocated with actions.

  • Each macro step can be replaced with the sequence string in the allocated macro section.

Macro steps are a supplement to IEC 61131-3 and must be enabled explicitly.

Input Step

Every macro section begins with an input step.

Representation of an input step:

Input steps have the following properties:

  • Input steps are automatically placed in macro sections by the SFC editor.

  • Only 1 individual input step is placed for each macro section.

  • An input step cannot be deleted, copied or inserted manually.

  • Each input step is implicitly allocated a variable of data type SFCSTEP_STATE, see SFCSTEP_STATE Variable.

  • Input steps can be allocated a variable of data type SFCSTEP_TIMES, see SFCSTEP_TIMES Variable.

  • Input steps can be allocated actions.

Output Step

Every macro section ends with an output step.

Representation of an output step:

Output steps have the following properties:

  • Output steps are automatically placed in macro sections by the SFC editor.

  • Only 1 individual output step is placed for each macro section.

  • An output step cannot be deleted, copied or inserted manually.

  • Output steps can NOT be allocated with actions.

  • Output steps can only be assigned a delay time. Assigning supervision times is not possible, see Step Times.

Macro Section

A macro section consists of a single sequence string having principally the same elements as a "sequence control" section (e.g. steps, initial step[s], macro steps, transitions, branches, joints, etc.).

Additionally, each macro section contains an input step at the beginning and an output step at the end.

Each macro step can be replaced with the sequence string in the allocated macro section.

Therefore, macro sections can contain 0, 1 or more initial steps, see also Step Types.

  • Single-Token

    • 0 Initial steps

      are used in macro sections, if there is already an initial step in the higher or lower section.

    • 1 Initial step

      is used in macro sections, if there are no initial steps in the higher or lower section.

  • Multi-Token

    A maximum of 100 initial steps can be placed per section (including all their macro sections).

Using macro sections:

The name of the macro section is identical to the name of the macro step that it is called from. If the name of the macro step is changed then the name of the respective macro section is changed automatically.

A macro section can only be used once.

Macro Step Processing

Macro Step Processing:

Phase

Description

1

A macro step is activated if the previous transition condition is TRUE.

At the same time, the input step in the macro section is activated.

2

The sequence string of the macro section is processed.

The macro step remains active as long as at least one step in the macro section is active.

3

If the output step of the macro section is active then the transitions following the macro step are enabled.

4

The macro step becomes inactive when the output step is activated which causes the following transition conditions to be enabled and the transition condition to be TRUE. At the same time, the output step in the macro section is activated.

Step Names

When creating a step, it is assigned with a suggested number.

Meanings of the Suggested Numbers:

Step Type

Suggested Number

Description

Macro Step

MS_i_j

MS = Macro Step

i = (internal) current (sequential) number of the current section

j = (internal) current (sequential) macro step number of the current section

Input step

MS_k_l_IN

MS = Macro Step

k = (internal) current (sequential) number of the calling section

l = (internal) current (sequential) macro step number of the calling section

IN = Input Step

Output step

MS_k_l_OUT

MS = Macro Step

k = (internal) current (sequential) number of the calling section

l = (internal) current (sequential) macro step number of the calling section

OUT = Output Step

"Normal" Step (within a macro section)

S_k_m

S = Step

k = (internal) current (sequential) number of the calling section

m = (internal) current (sequential) step number of the calling section

You can change the suggested numbers to give you a better overview. Step names (maximum 28 characters for macro step names, maximum 32 characters for step names) must be unique within the entire project, i.e. no other step, variable or section (with the exception of the name of the macro section assigned to the macro step) etc. may exist with the same name. There are no case distinctions. The step name must correspond with the standardized name conventions.

If the name of the macro step is changed then the name of the respective macro section and the steps within it are changed automatically.

For example If MS_1_1 is renamed to MyStep then the step names in the macro section are renamed to MyStep_IN, MyStep_1, ..., MyStep_n, MyStep_OUT.