Programming chapter 3 – Rockwell Automation 1772-AF1,D17726.5.1 User Manual MINI-PLC-2/15 User Manual
Page 43
Programming
Chapter 3
3Ć35
4.
Enter the operand.
You can enter the operand from the keyboard of your industrial terminal or
through ladder diagram functions. If we choose to enter 4095, the largest BCD
number that we can convert to a 12 bit binary number, we obtain the data tale
configuration shown in Figure 3.32.
Figure 3.32
AF1 BCD to Binary Conversion Function Format After Execution
17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0
S
Bit No.
Data Address
S
Result Address
Result
D
E
E = Enable Bit (1 = Function in Progress)
S = Sign Bit (1= Negative)
D = Done Bit (1 = Function Complete)
11495
ER
ER = Error Bit (1 = BCD Number > 4095 Entered)
Operand
200
201
300
(0)
0
0
4
0
9
5
(0) (0) (1) (0) 1 1 1 1 1 1 1 1 1 1 1 1
Entry and Display of Input and Result Values
Figure 3.33 shows one method for inserting input values and displaying inputs
and results of an AF1 BCD to binary conversion function. Although there are
other methods for accomplishing this, we chose get instructions. The first rung
requests an AF1 BCD to binary conversion. The top branch of the second rung
shows the BCD number that is to be converted (004095) in words 200 and 201.
The bottom branch shows in the hexadecimal notation FFF (bits 0 through 13 in
word 300 are set as shown in Figure 3.32).
Figure 3.33
AF1 BCD to Binary Conversion Function Input and Display Rungs
Bit
Storage
201
095
G
200
004
G
305
FFF
G
Execute Aux
Function
Function Number:
Data Addr:
Result Addr:
13
200
300