
Programming Actions and Conditions
S7-GRAPH for S7 300/400 Programming Sequential Control Systems
7-10
C79000-G7076-C526-01
Time (duration)
All actions containing one of the TL or TD instructions require a time (duration) to
be specified. The time is programmed with the following syntax:
<time> = IWy, QWy, MWy, LWy, DBWy, DIWy; variable of the type S5TIME,
WORD; S5T#time_cnstant
Y = 0 ... 65534
Arithmetic in Actions
You can provide statements with simple arithmetic expressions in actions. There
are assignments in the form
A:=B
,
A:=func(B)
and
A:=B<operator>C
. An action
containing an arithmetic expression requires the N instruction. The action can be
dependent on an event. This means that the assignment can either be executed
only when the relevant event occurs or in each cycle in which the step is active. As
an option, the action can also be combined with an interlock (letter C added).
Event
Instruction
Assignment
Meaning
--
N[C]
A:=B
A:=func(B)
A:=B<operator>C
As long as the step is active [and the interlock is
satisfied], the assignment is executed.
S0, S1, V0,
V1, L0, L1, A1,
R1
N[C]
A:=B
A:=func(B)
A:=B<operator>C
After the event occurs [and the interlock is true], the
assignment is executed.
Direct Assignments
You can enter direct assignments with the syntax A:=B. The following data types
can be used for a direct assignment:
•
8 bits: BYTE, CHAR
•
16 bits: WORD, INT, DATE, S5TIME
•
32 bits: DWORD, DINT, REAL, TIME, TIME_OF_DAY
The following table is an overview of all the permitted types of assignment. You can
assign not only addresses of the same type but also addresses with different data
types with the same length and addresses of different lengths to each other: