284 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 6 Compute/Math Instructions (CPT, ADD, SUB, MUL, DIV, MOD, SQR, SQRT, NEG, ABS)
Description: If the Destination is not a REAL, the instruction handles the fractional portion
of the result as follows:
If the Source is negative, the instruction takes the absolute value of the Source
before calculating the square root.
Arithmetic Status Flags: Arithmetic status flags are affected.
Fault Conditions: None
Execution:
Relay Ladder
Function Block
If the source is Then the fractional
portion of the result
Example
Not a REAL Truncates Source DINT 3
Destination DINT 1
A REAL Rounds Source REAL 3.0
Destination DINT 2
Condition Action
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true
The rung-condition-out is set to true.
Postscan The rung-condition-out is set to false.
Condition Action
Prescan No action taken.
Instruction first scan No action taken.
Instruction first run No action taken.
EnableIn is cleared EnableOut is cleared.
EnableIn is set The instruction executes.
EnableOut is set.
Postscan No action taken.