Addition, subtraction, multiplication and division – Rockwell Automation 1772-LS_LSP,D17726.8.6 PROG/OPER MANUAL-MINI PLC-2/05 User Manual
Page 90

Math Instructions
Chapter 10
10Ć2
Addition, Subtraction, Multiplication and Division
Addition
Reports the sum of two values from the two Get instructions immediately
preceding the addition instruction. Programmed in the output position of the
ladder diagram rung. The sum is stored in the add instruction word address.
030
320
+
032
700
G
031
380
G
When the sum exceeds 999, the overflow bit (bit 14) in the add instruction word
is set. When the processor is operating in the run, program, or remote test
mode, the overflow condition appears on the industrial terminal screen as a “1”
preceding the sum.
Important: If an overflow value (four digits) is used for subsequent
comparisons or other arithmetic operations, inaccurate results could occur.
030
999
+
032
1998
G
031
999
G
Subtraction
Reports the difference between two get values immediately preceding the
subtraction instruction. The second get word value is subtracted from the first
get word value. Programmed in the output position of the ladder diagram rung.
The difference is stored in the subtract instruction word address.
070
134
-
072
095
G
071
039
G
When the difference is a negative number, the underflow bit (bit 16) in the
subtract instruction word is set. When your processor is in the run, program, or
remote test mode, the negative sign appears on the industrial terminal screen
preceding the difference.
070
100
-
072
034
G
071
134
G
Important: Use only positive values. If you use a negative BCD value for
subsequent operation, inaccurate results could occur.