Ladder Diagram Safety Instructions

Routines in the safety task can use the following types of ladder diagram safety instructions.
When instructions that result in values with decimal place are used with REAL or LREAL operands, Rockwell Automation has verified the precision to six decimal places.

Advanced Math

Rockwell Automation has not done independent mathematical analysis of the numerical algorithms that are used in any of the following advanced math instructions. If you require a specific degree of accuracy, you must functionally test this instruction over your expected input domain.
Mnemonic
Name
Description
EXPT
X to the Power of Y
Returns the value of X to the power of Y.
LN
Natural Log
Compute the natural log of a number.
LOG
Log Base 10
Compute the log base 10 of a number.

Array (File)

Mnemonic
Name
Description
AVE
File Average
Calculate the mean/average over a set of values.
COP
Copy File
Copy binary data from one tag to another (no type conversion).
When you use the COP instruction in a safety routine, you must verify that the length is a constant and that the source and destination length are the same.
FAL
File Arithmetic and Logic
Perform copy, arithmetic, logic, and function operations on data that is stored in an array.
FLL
File Fill
Fill the elements of an array with the source value, while leaving the source value unchanged.
FSC
File Search and Compare
Compare the values in an array, element by element.
SIZE
Size in Elements
Find the size of a dimension of an array.
STD
File Standard Deviation
Calculate the standard deviation over a set of values.
BSL
Bit Shift Left
Shifts the specified number of bits to the left.
BSR
Bit Shift Right
Shifts the specified number of bits to the right.
FFL
FIFO Load
Store a value into an array by using first-in/first-out semantics.
FFU
FIFO Unload
Retrieve a value from an array by using last-in/first-out semantics.
LFL
LIFO Load
Store a value into an array by using last-in/first-out semantics.
LFU
LIFO Unload
Retrieve a value from an array by using last-in/first-out semantics.

Bit

Mnemonic
Name
Description
ONS
One Shot
Allows an event to occur one time on false-to-true edge of rung state.
OSR
One Shot Rising
Sets an output bit for one scan on the false-to-true (rising) edge of rung state.
OSF
One-Shot Falling
Sets an output bit for one scan on the true-to-false (falling) edge of rung state.
OTE
Output Energize
Controls a bit (it performs both Set and Clear operations that are based on rung state).
OTL
Output Latch
Set a bit (retentive).
OTU
Output Unlatch
Clear bit (retentive).
XIC
Examine if Closed
Examines the data bit to set or clear the rung condition.
XIO
Examine if Open
Examines the data bit to set or clear the rung condition.

Timer/Counter

Mnemonic
Name
Description
CTD
Count Down
Count down.
CTU
Count Up
Count up.
RES
Reset
Reset a timer or counter.
RTO
Retentive Timer On
Accumulate time.
TOF
Off-delay Timer
Time how long a timer is disabled.
TON
On-delay Timer
Time how long a timer is enabled.

Compare

Mnemonic
Name
Description
EQ
Equal To
Test whether two values are equal.
CMP
Compare
Perform a comparison on the arithmetic operations that you specify in the expression.
GE
Greater Than Or Equal To
Test whether one value is greater than or equal to a second value.
GT
Greater Than
Test whether one value is greater than a second value.
LE
Less Than or Equal To
Test whether one value is less than or equal to a second value.
LT
Less Than
Test whether one value is less than a second value.
LIMIT
Limit
Test whether a value falls within a specified range.
MEQ
Mask Equal To
Pass source and compare values through a mask and test whether they are equal.
NE
Not Equal
Test whether one value is not equal to a second value.

Move/Logical

Mnemonic
Name
Description
AND
Bitwise AND
Perform bitwise AND operation.
CLR
Clear
Clear a value.
MOVE
Move
Copy a value.
MVM
Masked Move
Copy a specific part of an integer.
NOT
Bitwise Not
Perform bitwise NOT operation.
OR
Bitwise Or
Perform bitwise OR operation.
SWPB
Swap Byte
Rearrange the bytes of a value.
XOR
Bitwise Exclusive Or
Perform bitwise exclusive OR operation.

Program Control

Mnemonic
Name
Description
AFI
Always False Instruction
Forces a rung to false (rung continues to execute).
EventTrigger
Trigger Event Task
Triggers one execution of an event task.
JMP
Jump To Label
Scan of logic jumps to a labeled location within the same routine.
JSR
Jump to Subroutine
Jump to a separate routine.
LBL
Label
Identifies a target location for a JMP instruction.
MCR
Master Control Reset
Forces every rung in a section of logic to execute in the False state.
NOP
No Operation
Insert a placeholder in the logic.
RET
Return
Return the results of a subroutine.
SBR
Subroutine
Accept data that the JSR instruction passes to a subroutine.
TND
Temporary End
Mark a temporary end that halts routine execution.

Safety

ATTENTION: Safety application instructions are the only instructions that can be used in the safety task for SIL 2 or SIL 3 applications.
Mnemonic
Name
Description
CROUT
Configurable Redundant Output
Controls and monitors redundant outputs.
DCM
Dual Channel Input - Monitor
Monitors dual-input safety devices.
DCS
Dual Channel Input Stop
Monitors dual-input safety devices whose main purpose is to provide a stop function, such as an E-stop, light curtain, or gate switch.
DCSTL
Dual Channel Input Stop With Test and Lock
Monitors dual-input safety devices whose main purpose is to provide a stop function, such as an E-stop, light curtain, or gate switch. It includes the added capability to initiate a functional test of the stop device. It can monitor a feedback signal from a safety device and issue a lock request to a safety device.
SMAT
Safety Mat
Indicates whether the safety mat is occupied.

Compute/Math

Rockwell Automation has done no independent mathematical analysis of the numerical algorithms that are used in the SQRT or SQR instructions. If you require a specific degree of accuracy, you must functionally test this instruction over your expected input domain.
Mnemonic
Name
Description
ABS
Absolute Value
Take the absolute value of a value.
ADD
Add
Add two values.
CPT
Compute
Perform the arithmetic operation that is defined in the expression.
DIV
Divide
Divide two values.
MOD
Modulo
Determine the remainder after one value is divided by a second value.
MUL
Multiply
Multiply two values.
NEG
Negate
Take the opposite sign of a value.
SQRT
Square Root
Calculate the square root of a value.
SUB
Subtract
Subtract two values.

Trigonometric

Rockwell Automation has not done independent mathematical analysis of the numerical algorithms in any of the following trigonometric instructions. If you require a specific degree of accuracy, you must functionally test this instruction over your expected input domain.
Mnemonic
Name
Description
ACOS
Arc Cosine
Compute the arc-cosine of a number.
ASIN
Arc Sine
Compute the arc-sine of a number.
ATAN
Arc Tangent
Compute the arc tangent in radians of y/x based on the sign of a value to determine the correct quadrant.
ATAN2
Arc Tangent 2
Compute the arc tangent in radians of y/x based on the signs of both values to determine the correct quadrant.
COS
Cosine
Compute the cosine of a number.
SIN
Sine
Compute the sin of a number.
TAN
Tangent
Compute the tangent of a number.

Math Conversion

Mnemonic
Name
Description
DEG
Degrees
Convert radians into degrees.
BCD_TO
Convert to Integer
Convert the BCD value to an integer value.
RAD
Radian
Convert degrees into radians.
TO_BCD
Convert to BCD
Convert the integer value to a BCD value.
TRUNC Truncate Remove the fractional part of a value.
Truncate
Remove the fractional part of a value.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal