• No results found

Sequential Function Charts

In document COMPUTER-AIDED SYSTEM SOFTWARE (Page 44-49)

11. THE IEC 61131 LANGUAGES

11.5. Sequential Function Charts

Sequential Function Chart diagrams are ranked above the other four languages in IEC. The SFC diagrams are high-level graphic tools.

11.5.1. Steps

Each SFC is built from the units, which provide step and jump conditions. Steps in SFC programs are displayed as rectangles. The actual work of a step is described in a certain dialog and isn’t displayed in the diagram. The purpose of the SFC step is represented by its name and, if it is not sufficient, by a concise text description (a comment).

Steps can be empty, and it doesn’t cause errors by project compiling. The empty steps are considered to be a standard in top-down programming, which is common to SFC. It is possible to identify the action corresponding to the step at any time.

11.5.2. Transitions

There is a horizontal line below the step on the connector line. This line displays a transition.

A Boolean variable, a Boolean statement, a constant, or a direct address can be used as conditions for a transition.

A transition is performed if both of the following conditions are met:

1) transitions is enabled (the step corresponding to this transition is active);

2) its condition has the TRUE value.

Simple conditions are displayed at the diagram right from the line, which describes the transition.

The approach to complicated conditions is quite different. The transition identifier is written in the diagram instead of condition. The condition is written in the diagram directly in a separate dialog window using IL, ST, LD, or FBD languages.

Variables or direct addresses are used in a condition only for reading. The POU call or assignment operations are impermissible in a conditional statement.

The fact, that the transition identifier is an individually realized condition, and not a simple Boolean variable, is indicated in the diagram by means of a small triangle in the upper corner of the ractangle.

A Boolean constant can be established as a condition for the transition. If the constant value is TRUE, the step will be performed just once within one running cycle. Then, the control is transferred to the subsequent step. If the constant value is FALSE, the step will be performed infinitely.

11.5.3. Initial Step

Each SFC begins with the step which box frame is graphically marked with a vertical double line or with a double line along the perimeter. This is the initial step. The initial step name is automatically generated (Init by default). The initial step is the obligatory element of SFC, although, it can be empty.

11.5.4. Parallel Branch

A sequential function chart can diverge, that is the processing line can be branched into two or several further lines («branches»). Parallel branches will be processed parallel (both at a time). Parallel branches within a chart are preceded by a horizontal double line (see Fig. 16). A parallel branch must begin and end with a step. I.e., the entry condition is common to all parallel branches, so as the output condition.

Figure 16. Parallel Branches

Theoretically, the parallel branches are executed simultaneously. Practically, they are executed in one running cycle from left to right.

The subsequent transition, which ends the parallel branches, is evaluated only if the last steps of all parallel branches are active.

Figure16: Step 2 will be processed just once. Steps 1 and 3 will be processed parallel to one another before the subsequent transition 4will be noticed.

11.5.6. Alternative Branch

Some of the SFC lines are alternative. The horizontal lines before and after the branched area are simple lines (see Fig. 17). An alternative branch must

beginning line is active, then the first transition of each alternative branch will be evaluated from left to right. The first transition from the left, whose transition condition has the TRUE value, will be opened and the following steps will be activated.

Figure 17. Alternative Branches

In this case, the а alternative is evaluated first. Steps 2 and 3 can be activated only if the а value is FALSE.

12. STANDARD COMPONENTS

12.1. Arithmetic Operators

Nearly all arithmetic operators have symbolic form to be written in ST language. In other IEC languages the operator call is performed in function form. Table 4 presents the list of the more common arithmetic operators.

Table 4

Arithmetic Operators

Operator Symbol Operation Type of Parameters

ADD + Addition ANY_NUM, TIME SUB – Subtraction ANY_NUM, TIME MUL * Multiplication ANY_NUM, TIME DIV / Division ANY_NUM, TIME MOD MOD Remainder of Division ANY_INT

ЕХРТ ЕХРТ Exponentiation IN1 ANY_NUM, IN2 ANY_INT MOVE := Assignment ANY

Arithmetic operators are reloaded: the type of operation result is defined by operand type.

MUL and ADD can be extended in graphical languages, i.e., any random number can be added to these operations.

The variables of type TIME can be added and subtracted together. One variable of the type TIME multiplied and divided by a number. The result obtained is always of the TIME type.

The operation MOD is applied only for set of integers.

The operation MOVE has only one parameter of an appropriate type. MOVE is available as a box in graphic languages only. The value of one variable or the constant of another variable in IL are assigned by the instructions LD and ST.

In document COMPUTER-AIDED SYSTEM SOFTWARE (Page 44-49)

Related documents