Programming chapter 3 – Rockwell Automation 1772-AF4,D17726.5.3 User Manual, AUX FUNCT PROM User Manual

Page 36

Advertising
background image

Programming

Chapter 3

3Ć28

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 table
configuration shown in Figure 3.20.

Figure 3.20

Af4 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.21 shows one method for inserting input values and displaying inputs
and results of an AF4 BCD to binary conversion. Although there are other
methods for accomplishing this, we chose get instructions. The first rung
requests an AF4 BCD to binary conversion. The top branch of the second rung
shows the BCD number we want to convert (004095) in words 200 and 201.
The bottom branch shows in the hexadecimal notation FFF (bits 0 through 13 in
word 300 have the states shown in Figure 3.20).

Figure 3.21

AF4 BCD to Binary Conversion Function Input and Display Rungs

200

004

G

300

FFF

G

201

095

G

Bit

Storage

Execute Aux

Function

Function Number:
Data Addr:
Result Addr:

13

200
300

Advertising