beautypg.com

6ć12, 1 add instruction – Rockwell Automation 1772-LP3 PLC - 2/30 Programmable Controller Programming and Operations Manual User Manual

Page 134

background image

Data Manipulation Instructions

Chapter 6

6Ć12

Figure 6.12

Arithmetic Instruction Word

17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00

Most

Significant

Digit

Middle

Digit

Least

Significant

Digit

BCD Value Holds

Arithmetic Result

Overflow Bit Set to 1

When Sum Exceeds 999.

Underflow Bit Set to 1 When

Difference is Negative Number.

The conversion instructions are in block format. They don’t require Get
instructions. The 12-bit binary value is stored in one word and the BCD
value is stored in two consecutive data table words. Any condition
instructions can be programmed before a conversion instruction.
Appendix B gives more information on Binary and BCD number systems.

The Add instruction tells the processor to add the two values stored in the
Get words. The sum is then stored at the Add instruction word address.
When the sum exceeds 999, the overflow bit (bit 14) in the Add instruction
word is set on (Figure 6.13). In the run, test or run/prog mode, the
overflow condition is displayed on the industrial terminal screen as a 1.

NOTE: If an overflow value (4 digits) is used for subsequent comparisons
or other arithmetic operations, inaccurate operations will occur. The
processor performs arithmetic and data manipulation operations with
3-digit BCD values only. In subsequent rungs, the overflow bit may be
examined to determine if an overflow exists.

6.4.1
Add Instruction