Instructions¶
Every ladder instruction, generated from the instruction set. The IEC column is the name shown in the IEC-symbols notation (Tools → Options). Operands in italics are optional.
Bit¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
XIC |
NO |
Examine if closed (normally open contact) | Bit (bool) |
XIO |
NC |
Examine if open (normally closed contact) | Bit (bool) |
OTE |
COIL |
Output energize (coil) | Bit (bool) |
OTL |
S |
Output latch (set coil) | Bit (bool) |
OTU |
R |
Output unlatch (reset coil) | Bit (bool) |
ONS |
P_TRIG |
One shot (rising edge of the rung) | Storage bit (bool) |
OSR |
OSR |
One shot rising | Storage bit (bool) Output bit (bool) |
OSF |
OSF |
One shot falling | Storage bit (bool) Output bit (bool) |
P |
P |
Positive edge of an operand | Operand (bool) Edge memory bit (bool) |
N |
N |
Negative edge of an operand | Operand (bool) Edge memory bit (bool) |
Timer/Counter¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
TON |
TON |
Timer on delay | Timer (timer) Preset (time) Accum (value) |
TOF |
TOF |
Timer off delay | Timer (timer) Preset (time) Accum (value) |
RTO |
RTO |
Retentive timer on | Timer (timer) Preset (time) Accum (value) |
TP |
TP |
Pulse timer | Timer (timer) Preset (time) Accum (value) |
CTU |
CTU |
Count up | Counter (counter) Preset (value) Reset (bool) |
CTD |
CTD |
Count down | Counter (counter) Preset (value) Load (bool) |
RES |
RESET |
Reset a timer, counter or control | Timer or counter (element) |
Compare¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
EQU |
CMP == |
Equal | Source A (value) Source B (value) |
NEQ |
CMP <> |
Not equal | Source A (value) Source B (value) |
LES |
CMP < |
Less than | Source A (value) Source B (value) |
LEQ |
CMP <= |
Less than or equal | Source A (value) Source B (value) |
GRT |
CMP > |
Greater than | Source A (value) Source B (value) |
GEQ |
CMP >= |
Greater than or equal | Source A (value) Source B (value) |
LIM |
IN_RANGE |
Limit test (value within range) | Low limit (value) Test (value) High limit (value) |
MEQ |
MEQ |
Masked equal | Source (value) Mask (value) Compare (value) |
Math¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
ADD |
ADD |
Add | Source A (value) Source B (value) Dest (dest) |
SUB |
SUB |
Subtract | Source A (value) Source B (value) Dest (dest) |
MUL |
MUL |
Multiply | Source A (value) Source B (value) Dest (dest) |
DIV |
DIV |
Divide | Source A (value) Source B (value) Dest (dest) |
MOD |
MOD |
Modulo | Source A (value) Source B (value) Dest (dest) |
NEG |
NEG |
Negate | Source (value) Dest (dest) |
SQR |
SQRT |
Square root | Source (value) Dest (dest) |
SCP |
SCP |
Scale with parameters | Input (value) Input min (value) Input max (value) Scaled min (value) Scaled max (value) Output (dest) |
NORM_X |
NORM_X |
Normalize to 0.0-1.0 | Min (value) Value (value) Max (value) Out (dest) |
SCALE_X |
SCALE_X |
Scale 0.0-1.0 to a range | Min (value) Value (value) Max (value) Out (dest) |
Move/Logical¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
MOV |
MOVE |
Move | Source (value) Dest (dest) |
NOT |
NOT |
Bitwise NOT | Source (value) Dest (dest) |
TOD |
TO_BCD |
Convert to BCD | Source (value) Dest (dest) |
FRD |
FROM_BCD |
Convert from BCD | Source (value) Dest (dest) |
AND |
AND |
Bitwise AND | Source A (value) Source B (value) Dest (dest) |
OR |
OR |
Bitwise OR | Source A (value) Source B (value) Dest (dest) |
XOR |
XOR |
Bitwise XOR | Source A (value) Source B (value) Dest (dest) |
MVM |
MVM |
Masked move | Source (value) Mask (value) Dest (dest) |
CLR |
CLR |
Clear | Dest (dest) |
Array¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
BSL |
BSL |
Bit shift left | Array (array) Control (control) Source bit (bool) Length (value) |
BSR |
BSR |
Bit shift right | Array (array) Control (control) Source bit (bool) Length (value) |
SQO |
SQO |
Sequencer output | Array (array) Mask (value) Dest (dest) Control (control) Length (value) Position (value) |
SQC |
SQC |
Sequencer compare | Array (array) Mask (value) Source (value) Control (control) Length (value) Position (value) |
SQL |
SQL |
Sequencer load | Array (array) Source (value) Control (control) Length (value) Position (value) |
COP |
COP |
Copy array elements | Source (array) Dest (array) Length (value) |
FLL |
FLL |
Fill array elements | Source (value) Dest (array) Length (value) |
Program Control¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
JSR |
CALL |
Jump to subroutine (call a routine) | Routine (routine) |
RET |
RET |
Return | — |
CALL |
CALL |
Call a function or function block | Block (block) up to 8 parameters Name:=value or Name=>tag |
NOP |
NOP |
No operation | — |
Process¶
| Mnemonic | IEC | What it does | Operands |
|---|---|---|---|
PID |
PID |
PID controller | PID (pid) Process variable (value) Control variable (dest) Setpoint (value) Tieback (value) Master loop (pid) Inhold bit (bool) Inhold value (value) |
PID¶
Every loop update time (UPD) while the rung is true. The process variable is scaled from MINI..MAXI to MINS..MAXS (engineering units), the output in % goes to the control variable scaled to MINCV..MAXCV. Optional: a setpoint (else the SP member), a tieback the output follows in manual, a master loop whose output (in %) becomes this loop's setpoint (cascade), and an inhold bit that holds the output at the inhold value (bumpless restart). PID Setup in the editor sets the members.
CALL¶
A function by name, a function block by its instance (Motor1, or #Inner inside a block).
Parameters: Start:=Button (input) or Running=>Lamp (output). EN → ENO.