Step Element

Help Contents

Introduction

The Step Elements in an SFC represent the states of a flow diagram.

Step Element Syntax

The Step Element has this syntax:

step-element ::= [ INITIAL_STEP | STEP ] step-name
  { action }
END_STEP

action := action-name( action-qualifier [, time-interval ] )

action-qualifier := [ N | S | R | P | D | L | SD | DS | SL | P1 | P0 ]

Where:

Remarks

Each SFC requires one initial step declared with the INITIAL_STEP keyword. The initial step is activated when the SFC program starts.

You can associate zero or more Action Elements with each Step Element. The Action Qualifier defines when the Action Element is run when the step is active. Use this table to choose which action qualifiers are correct for your application:

QualifierNameDescription
N Non-Stored The action runs while the step is active.
L Time Limited The action runs until either of these events occurs first:
  • The timeout completes.
  • The step is deactivated.
D Time Delayed The action starts after a time delay. The action stops when the step is deactivated. If the step is deactivated before the time delay completes the action does not run.
P Pulse The action is run once when the step is activated. The action is run again when the step is deactivated.
P1 Pulse (Rising Edge) The action is run once when the step is activated.
P0 Pulse (Falling Edge) The action is run once when the step is deactivated.
S Stored The action runs until a Reset (R) turns off the action. The action continues to run after the step is deactivated.
SL Stored and Time Limited The action runs until either of these events occurs first:
  • The timeout completes.
  • The action is reset.
SD Stored and Time Delayed The action starts after a time delay even if the step is not active. The action is stopped by a Reset (R).
DS Delayed and Stored The action starts after a time delay provided the step is still active. The action is stopped by a Reset (R).
R Reset Turns off any of these stored actions:
  • S - Stored
  • SD - Stored and time delayed
  • DS - Delayed and stored
  • SL - Stored and time limited

Control is passed from one Step Element to another using a Transition Element.

Each Step Element in an SFC is implicitly declared as a variable in the host Program. The Step Element variable is equivalent to the following STRUCT Type:

STRUCT
    IN : BOOL;
    X : BOOL;
    T : TIME;
    StartTime : DATE_AND_TIME;
END_STRUCT;

Where:

MemberDescription
IN Set to TRUE when the transitions to this Step Element are active and TRUE.
X TRUE when the Step Element is active. FALSE when the Step Element is not active.
T The elapsed time that the Step Element is active.
StartTime The date and time when the Step Element was set active.

You can reference member variables of the Step Element in Action Elements and Transition Elements. A common technique is to reference the T member variable in a Transition Element to provide a time limit for the step. For example:

TRANSITION FROM FillStep TO NextStep
    FillStep.T >= T#30s
END_TRANSITION

It is an error to try and assign a value to data members of the Step Element.

Examples

  1. A step that runs an action run once when the step is activated:
    STEP StartPump
        StartPump( P1 )
    END_STEP
  2. A step that runs an action for a limited time period:
    STEP EmptyVessel
        RunPump( L, T#10s )
    END_STEP

Standards Compliance

IEC 61131-3 Second Edition: Table 40 & Table 43.

IEC 61131-3 Third Edition: Table 54 & Table 57.

Further Information

Sequential Function Chart

For general information about Sequential Function Charts.

IEC 61131-3

For information about IEC 61131-3 scripts.

Glossary

For the meaning of terms used in Fernhill SCADA.