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

Page 35

Advertising
background image

Programming

Chapter 3

3Ć27

2.

Enter 13, the function number for AF4 BCD to binary conversion.

This entry identifies that the function entered is to perform an AF4 BCD to
binary conversion and that the processor use the data table format shown in
Figure 3.18 when executed.

Figure 3.18

General AF4 BCD to Binary 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

11493

ER

ER = Error Bit (1 = BCD Number > 4095 Entered)

m

m + 1

n

Operand

Digit 4

Digit 6

(LSD)

Digit 2

(Always = 0)

(Must be

3

4)

3.

Enter a data address and a result address.

If we choose a data address of 200 and a result address of 300, the data table
format is as shown in Figure 3.19. The most significant three digits of the
operand (the BCD number we want to convert to binary) reside in the data
address word 200 and the least significant three digits reside in the next higher
address, 201. The first two digits are always zero and the third digit must not
exceed four. The number, converted to binary format, is stored in bits 0 through
13 in the result address, word 300.

Figure 3.19

AF4 BCD to Binary Conversion Function Format After Address Only

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

11494

ER

ER = Error Bit (1 = BCD Number > 4095 Entered)

Operand

Digit 4

Digit 6

(LSD)

Digit 2

(Always = 0)

200

201

300

(Must be

3

4)

Advertising