Actions in a SFC step

Each step has a list of action blocks, that are instructions to be executed according to the activity of the step. Actions can be simple boolean or SFC actions, that consists in assigning a boolean variable or control a child SFC program using the step activity, or action blocks entered using another language (FBD, LD, ST or IL).

Runtime check:

Below are the possible syntaxes you can use within an SFC step to perform runtime safety checks:

__StepTimeout (...); Check for a timeout on the step activity duration.

Simple boolean actions:

Below are the possible syntaxes you can use within an SFC step to perform a simple boolean action:

BoolVar (N); Forces the variable "BoolVar" to TRUE when the step is activated, and to FALSE when the step is de-activated.
BoolVar (S); Sets the variable "BoolVar" to TRUE when step is activated
BoolVar (R); Sets the variable "BoolVar" to FALSE when step is activated
/ BoolVar; Forces the variable "BoolVar" to FALSE when the step is activated, and to TRUE when the step is de-activated.

Alarms:

The following syntax enables you to manage timeout alarm variables:

BoolVar (A, duration); Specifies a timeout variable to be associated to the step.
- "BoolVar" must be a simple boolean variable
- "duration" is the timeout, expressed eiter as a constant or as a single TIME variable
  (complex expressions cannot be used for this parameter)
When the timeout is elapsed, the alarm variable is turned to TRUE, and the transition(s) following the step cannot be crossed until the alarm variable is reset.

Simple SFC actions:

Below are the possible syntaxes you can use within an SFC step to control a child SFC program:

Child (N); Starts the child program when the step is activated and stops (kills) it when the step is de-activated.
Child (S); Starts the child program when the step is activated
Child (R); Stops (kills) the child program when the step is activated

Programmed action blocks:

Programs in other languages (FBD, LD, ST or IL) can be entered to describe an SFC step action. There are three main types of programmed action blocks, that correspond to the following identifiers:

P1 Executed only once when the step becomes active
N Executed on each cycle while the step is active
P0 Executed only once when the step becomes inactive

The workbench provides you templates for entering P1, N and P0 action blocks in either ST, LD or FBD language. Alternatively, you can insert action blocks programmed in ST language directly in the list of simple actions, using the following syntax:

    ACTION ( qualifier ) :
        statements...
    END_ACTION;

Where qualifier is "P1", "N" or "P0".