Child SFC POUs

Any Sequential Function Chart (SFC) program organization unit (POU) may control other SFC POUs. These level units are called child SFC POUs. A child SFC POU is a parallel unit that can be started, terminated, frozen, or restarted by its parent. The parent POU and child POU must both be described with the SFC language. A child SFC POU can have local variables.
TIP: When using version control, do not use child SFC POUs. Use only SFC programs and function blocks in the application.
When a parent POU starts a child SFC, the parent places an SFC token (activates) into each initial step of the child. This command is described with the GSTART statement or with the name of the child with the S qualifier. When a parent POU terminates a child SFC, it clears all the tokens existing in the steps of the child. Such a command is described with the GKILL statement or with the name of the child and the R qualifier. When a parent POU starts a child, the parent continues its execution.
When a parent POU freezes a child SFC, the parent clears all the tokens existing in the child, and keeps their position in memory. Such a command is described with the GFREEZE statement. When a parent POU restarts a frozen child SFC, it restores all the tokens cleared when the child was frozen. Such a command is described with the GRST statement.
Child SFC function block instances, as for their SFC function block parents, have a maximum number of tokens, unlike SFC programs whose dynamic behavior limits are set at the controller level. Specify the tokens limit for an SFC function block in its settings properties.
When using an SFC function block with an SFC child, access, for read-only purposes, the local values of the child from its parent by entering the child’s name and the parameter in an action or transition’s code. Example: to access the
Local1
parameter of an SFC child named
FB_Child
, in an action or transition defined for the SFC function block parent, write this syntax:
FB_Child.Local1
Task
Procedure
Add a child SFC POU
  • In the
    Application View
    , right-click an existing SFC POU, and then click
    Add SFC Child
    .
Move a child SFC POU
  • In the
    Application View
    , drag the SFC POU to the required position and hierarchy level.
    TIP: When moving an SFC POU with children, the children follow their parent. A child SFC POU can be moved to a different main SFC POU or to a different hierarchy level. A child SFC POU can only be moved to hierarchical levels that already contain an SFC child.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal