beautypg.com

6ć11 – Rockwell Automation 1772-LP3 PLC - 2/30 Programmable Controller Programming and Operations Manual User Manual

Page 133

background image

Data Manipulation Instructions

Chapter 6

6Ć11

The PLC-2/30 processor can be programmed to perform arithmetic
operations with two BCD values using a set of arithmetic instructions and
can perform conversions from 12-bit binary to BCD and vice versa. These
output instructions are:

Add –(+)–

Subtract –(–)–

Multiply –(A x B)–

Divide –(

÷

)–

Convert BCD to BIN (Binary) and BIN to BCD

For arithmetic instructions, the two 3-digit BCD values to be operated on
are stored in two Get instruction words. The Get instructions, programmed
in the condition area of the ladder diagram rung, should be followed by
the arithmetic instruction. Other condition instructions, if used, should be
programmed before the Get instructions.

The arithmetic instructions are programmed in the output position of the
ladder diagram rung. They are assigned either one or two data table words
to store the computed result, depending on the arithmetic operation
performed. The Add and Subtract instructions use one data table word to
store the result. The Multiply and Divide use two data table words to store
the result.

The computed result is stored in BCD format in the lower 12 bits of the
arithmetic instruction word (Figure 6.12). Two of the remaining bits (bits
14 and 16) are used to indicate overflow and underflow conditions.

6.4
Arithmetic Instructions