6ć18 – Rockwell Automation 1772-LP3 PLC - 2/30 Programmable Controller Programming and Operations Manual User Manual
Page 140
Data Manipulation Instructions
Chapter 6
6Ć18
DATA – The BCD number is 004095 (the largest BCD number that can
be converted to a 12-bit binary number).
BINARY
ADDR – Data Table word 025
DATA – The industrial terminal will display 12 ones (1), the binary
representation of the decimal number 004095.
Figure 6.18
BCDĆtoĆBinary Conversion Example Rung
BCD TO BINARY
BCD
ADDR: 200- 201
DATA: 004095
BINARY
ADDR: 025
DATA: 111111111111
025
(OV)
14
On a true rung decision, this output instruction will convert a 12-bit binary
number to a BCD number (from 0 to 4095). The BCD number will not
exceed 004095 when it is converted from a 12-bit binary number. The
upper 4 bits of the binary data will be transferred to the lower 4 bits of the
lower BCD address.
If the binary data changes while the rung is true, the BCD result will
also change. If the binary value is greater than 4095 (for example, if
the reading from an analog input module is an overflow condition), the
overflow bit, bit 14 of the binary address will be set ON.
To program a Binary-to-BCD conversion, press keys [CONVERT] 1. A
display represented by Figure 6.19 will appear.
Figure 6.20 shows the symbolic format of Figure 6.19 after the following
conditions have been entered:
Convert the Binary number 111111111111 to BCD
6.7
BinaryĆtoĆBCD Conversion
6.7.1
Programming a BinaryĆtoĆ
BCD Conversion Instruction