Rockwell Automation 1771-DA,D17716.5.13 U MNL 1771-DA ASCII I/O MODULE User Manual
Page 128
![background image](/manuals/579280/128/background.png)
ASCII I/O Module Tutorial
Chapter 4
4Ć54
Converting Binary to BCD
You convert binary values to BCD values by moving them to a decimal
file. Use a MOV instruction.
Source word A is the message variable in binary.
Destination word R is the message variable converted to BCD.
Your program converts binary to BCD in rung RM19 (Figure 3.6).
Using Output Files
The PLC-3 makes no conversion when moving data out of or into output
and input files. Use output files to store your ASCII data and/or messages
along with message variables that your program has converted to BCD.
Inserting the Message Variable
When you enter the message into the message storage file using the data
monitor mode of the industrial terminal, do the following:
1. Identify the file word(s) that you reserved for the message variable
(Figure 3.9,RM19, WO006:0007).
2. Separate the message variable from the rest of the message using
BCD delimiters.
3. Locate the first delimiter in the lower byte of the word before, the
second delimiter in the upper byte of the word after the word(s)
containing the message variable.
4. Enter the (first) word containing the message variable as the
destination word R in the decimal-to-output MOV instruction
(Figure 3.9, RM 19, WO006:0007).
For example, refer to rung RM19 (Figure 3.9) and display the message
file O6:0. Look at display words 6, 7, and 8 containing the delimiters and
message variable. The message variable is stored in word 7.