430
SECTION
3
PLC
Programming
Industrial Text & Video Company 1-800-752-8398
www.industrialtext.com
CHAPTER
10
The IEC 1131 Standard and
Programming Language
Boolean • NOT: Boolean negation
• AND(&): logical AND
• OR: logical OR
• XOR: logical exclusive-OR
• REDGE: rising-edge detection
• FEDGE: falling-edge detection
Arithmetic • Addition: +
• Subtraction: –
• Multiplication: ×
• Division: /
Comparison • Less than: <
• Greater than: >
• Less than or equal to: <=
• Greater than or equal to: >=
• Equal to: =
• Not equal to: <>
Basic statements • Assignment (:+)
• RETURN statement
• IF-THEN-ELSE structure
• CASE statement
• WHILE iteration statement
• REPEAT iteration statement
• FOR iteration statement
• EXIT statement
Extensions • TSTART–TSTOP: timer control
• SYSTEM function
• OPERATE function
Controls the • GSTART: starts an SFC program
execution of SFC • GKILL: kills an SFC program
child programs • GFREEZE: freezes an SFC program
• GRST: restarts a frozen program
• GSTATUS: gets current status of an SFC program
Acesses the status • GSnnn.x: Boolean value that represents the
of an SFC step activity of the step
• GSnnn.t: time elapsed since last activation of the
step (
nnn
is the reference number of the SFC step)
—(SET)—
—(RST)—
—(RET)—
—(JMP)—
STRUCTURED
TEXT OPERATORS
AND S
TATEMENTS
LADDER
DIAGRAM SYMBOLS
Symbol
Description
Normally open contact (examine-ON)
Normally closed contact (examine-OFF)
Output coil
NOT, or inverted, output coil
Set output coil
Reset output coil
Return—used as the conditional end of a program
or to return from a ladder diagram subprogram
Jump to a label “LAB”
INSTRUCTION
LIST
OPERATORS
LD N Variable, constant Loads operand
ST N Variable Stores current result
S Bool variable Sets to TRUE
R Bool variable Resets to FALSE
AND (&) N( Bool variable Boolean AND
OR N( Bool variable Boolean OR
XOR N( Bool variable Exclusive-OR
ADD ( Variable, constant Addition
SUB ( Variable, constant Subtraction
MUL ( Variable, constant Multiplication
DIV ( Variable, constant Division
GT ( Variable, constant Test:>
GE ( Variable, constant Test:>=
EQ ( Variable, constant Test:=
LE ( Variable, constant Test:<=
LT ( Variable, constant Test:<
JMP C N Label Jump to a label
RET Returns from subprogram
) Delayed operation/execution
Note:
N
is used for negation (NOT) of the operand.
(
is used to indicate that the operation is to be delayed.
C
is used to indicate a conditional operation.
Type
Operators
Table 10-5. ISaGRAF instruction set.
Operator
Modifier Operand
Description