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 SFCClosed"Sequential function chart" It can be used to program processes that can be split into steps. The main components of SFC are: - Steps with associated actions - Transitions with associated logic conditions - Directed links between steps and transitions 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 (FBDClosed"Function block diagram" A function block diagram describes a function between input variables and output variables. A function is described as a set of elementary blocks, FFLD, STClosed"Structured text" A high-level language that is block structured and syntactically resembles Pascal or ILClosed"Instruction list" This is a low-level language and resembles assembly).

RuntimeClosedIn computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). Within KAS, runtime also refers to the virtual machine that manage the program written in a computer language while it is running check:

Below are the possible syntaxes you can use within an SFC step to perform runtimeClosedIn computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). Within KAS, runtime also refers to the virtual machine that manage the program written in a computer language while it is running 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 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, and to TRUE when the step is deactivated.

Alarms:

The following syntax enables you to manage timeout alarm variables:

BoolVar (A-, duration);

Specifies a Min 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 min timeout is elapsed, the alarm variable is turned to TRUE.

BoolVar (A+, duration);

Specifies a Max 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, and the transition(s) following the step cannot be crossed until the alarm variable is reset to FALSE.

BoolVar (A, duration);

Another syntax to specify the Max timeout variable.

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 deactivated.

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, FFLD, 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

Figure 8-59: SFC step action blocks

The KAS IDEClosed"Integrated development environment" An integrated development environment is a type of computer software that assists computer programmers in developing software. IDEs normally consist of a source code editor, a compiler and/or interpreter, build-automation tools, and a debugger provides you templates for entering P1, N and P0 action blocks in either ST, FFLD 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".