110 Rockwell Automation Publication 1756-RM100F-EN-P - October 2018
Chapter 6 Instruction Execution
Math-related Instructions
This section describes the changes in math-related instructions, and apply to
the following:
• TRN Instruction Changes
• Improved Math Instruction Accuracy
• SQR/SQRT Adjustment
• X Mod 0
• AND, NOT, OR, and XOR Support for REAL
• Floating Point Literals
• XPY Instruction
• 0.0 div 0.0
TRN Instruction Changes
Previously, if a large real number was truncated, overflow of the internal math
that the instructions performs was possible. As a result, the instruction
returned a zero. Some large reals that failed and returned a zero when truncated
now return a value.
In RLL, S:V is set properly when the value that is truncated is too large to be
stored in the destination. With this implementation, the truncation of real
values to real destinations is more likely to complete without errors.
Mitigation
Modify any existing code that relied on obtaining a zero result instead of range-
checking the input value.
IMPORTANT Manually determine the impact to your application and correct accordingly.
Language Affected
Ladder Logic (RLL) Yes
Struc tured Text (ST) Yes
Function Blocks (FBD) No
Sequential Function Chart (SFC) Yes
(1)
(1) Only affects embedded Structured Text.
5580/5380 Controllers 5570/5370 Controllers