![Allen-Bradley PLC-2/30 Programming And Operations Manual Download Page 136](http://html1.mh-extra.com/html/allen-bradley/plc-2-30/plc-2-30_programming-and-operations-manual_2900216136.webp)
Data Manipulation Instructions
Chapter 6
613
Figure 6.13
Add Instruction
||
11
( + )
1034
111
032
| G |
520
030
| G |
514
031
Must be true to allow
arithmetic operation
Overflow will cause
a 1 to be displayed
Result stored at this
word address
The Subtract instruction tells the processor to subtract the second Get word
value from the first Get word value (Figure 6.14). The difference is then
stored at the data table word addressed by the Subtract instruction.
If the difference is a negative number, the underflow bit of the Subtract
word (bit 16) is set on. In the run, test or run/prog mode, the negative sign
will appear on the industrial terminal screen.
Figure 6.14
Subtract Instruction
||
14
( - )
009
111
042
| G |
100
130
| G |
109
041
Must be true to allow
arithmetic operation
Underflow will cause
negative sign to be
displayed but not used
Result stored at this
word address
NOTE: If a negative BCD value is used for subsequent operations,
inaccurate results will occur. The processor only compares, transfers and
computes the absolute BCD value. In subsequent rungs, the underflow bit
may be examined to determine if an underflow exists.
6.4.2
Subtract Instruction
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com