The following example shows the time behavior of an SFC program, its associated step flags and some Boolean variables set directly in the action association field and in actions or transitions. In particular, the example shows the meaning of the action qualifiers.
Step1 has been assigned to:
a Boolean variable bVarStep1_P with a pulse action qualifier P which is set to TRUE only in the first scan of Step1
a Boolean variable bVarStep1_S_R with a store action qualifier S which is set to TRUE during Step1 and remains TRUE after leaving Step1 until it is explicitly reset to FALSE in Step3
a Boolean variable bVarStep1_N with the default non-stored qualifier N which is TRUE only during the execution of the step
an action program Action1 with the default action qualifier N which is executed while Step 1 is active.
In this action:
bVarAction1_N is TRUE or FALSE depending on the step flag Step1.X, which is TRUE during the execution of Step1 and FALSE in the last scan of Step1. Note: Its behavior is not identical to bVarStep1_N.
bVarAction1_S is set to TRUE during the execution of Step1 and keeps its value after leaving Step1.
Step2 has been assigned no action.
Step3 has been assigned a Boolean variable bVarStep1_S_R with the overriding reset qualifier R which resets the variable in the first scan of the step.
one PLC scan |
steps and transitions |
actions |
Use a step flag to verify that a step has been scanned for the last time after the following transition condition has become TRUE. In this case the value of the step flag is FALSE.
Use the system variable sys_bIsFirstScanOfSfcStep to verify that a step has been scanned for the first time. The variable must be TRUE.