Actions in an 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.
  • The actions consists in assigning a Boolean variable or control a child SFC program using the step activity, or action blocks entered using another language (FBD, FFLD, ST or IL).

Runtime Check

This is a possible syntax to use in an SFC step to perform runtime safety checks:

Syntax

Description

__StepTimeout (...);

Check for a timeout on the step activity duration.

See Timeout on an SFC Step for more information.

Simple Boolean Actions

These are the possible syntaxes to use within an SFC step to perform a simple Boolean action:

Syntax

Description

BoolVar (N);

Forces the variable BoolVar to:

  • TRUE when the step is activated.
  • FALSE when the step is deactivated.

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.
  • TRUE when the step is deactivated.

Alarms

This syntax is used to manage timeout alarm variables:

Syntax

Description

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 either 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.
  • The transition(s) following the step cannot be crossed until the alarm variable is reset.

Simple SFC Actions

These are possible syntaxes to use within an SFC step to control a child SFC program:

Syntax

Description

Child (N);

  • Starts the child program when the step is activated.
  • Stops it when the step is deactivated.

Child (R);

Stops the child program when the step is activated

Child (S);

Starts the child program when the step is activated

Programmed Action Blocks

Programs in other languages (FBD, FFLD, ST, or IL) can be entered to describe an SFC step action.

These are the main types of programmed action blocks that correspond to these identifiers:

Identifier

Description

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 KAS-IDE provides templates for entering P1, N, and P0 action blocks in either ST, FFLD, or FBD language.

Alternatively, you can insert action blocks programmed in the ST language directly in the list of simple actions, using this syntax:

ACTION ( qualifier ) :
     statements...
END_ACTION;

Where qualifier is P1, N, or P0.