Rockwell Automation 1772-AF1,D17726.5.1 User Manual MINI-PLC-2/15 User Manual
Page 44

Programming
Chapter 3
3Ć36
Error Message
If you enter a BCD number larger than 4095, the error bit (bit 14) is set and the
result reads zero.
AF1 Binary to BCD Conversion Function
The AF1 binary to BCD conversion function converts a 12-bit binary number to
a BCD number (from 0 to 4095).
How to Enter an AF1 Binary to BCD Conversion Function
To program an AF1 binary to BCD conversion function, perform the following
steps:
1.
Press [SHIFT] [EAF] or [SHIFT] [SCT] on the keyboard of your
industrial terminal. Figure 3.1 appears on the CRT.
2.
Enter 14, the function number for the AF1 binary to BCD conversion
function.
This entry identifies that the function entered is to perform an AF1 binary to
BCD conversion and that the processor use the data table format shown in
Figure 3.34 when executed.
Figure 3.34
General AF1 Binary to BCD Conversion Function Word and Digit Format
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
S
Digit 1 (MSD)
(Always = 0)
Digit 3
Bit No.
Data Address
Digit 5
S
Result Address
Result
D
E
E = Enable Bit (1 = Function in Progress)
S = Sign Bit (1= Negative)
D = Done Bit (1 = Function Complete)
MSD = Most Significant Digit
LSD = Least Significant Digit
11496
m
n + 1
n
Operand
Digit 4
Digit 6
(LSD)
Digit 2
(Always = 0)
12 Bit Binary Number