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

Page 62

Advertising
background image

Programming

Chapter 3

3Ć54

3.

Enter a data address and a result address.

If we choose a data address of 200 and a result address of 305, the data table is
as shown in Figure 3.56. The three digits of word 200 are reserved for the
operand (the number whose square root we want). The result address (word
305) is reserved for the three digits of 4, the base number of the answer with an
implied decimal point located after the MSD. The next higher address than the
result address, (word 306) contains s, the power of 10. The implied decimal
point in this number is after the LSD; the MSD and digit 2 are always zero.

Figure 3.56

AF4 Square Root Function Format After Address Entry

17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0

Digit 1

(MSD)

Digit 2

Bit No.

Data Address

Digit 2

Digit 2

Result Address

D

E

E = Enable Bit (1 = Function in Progress)
D = Done Bit (1 = Function Complete)
MSD = Most Significant Digit

LSD = Least Significant Digit

11521

Digit 3

(LSD)

Digit 3

Digit 1

(MSD)

Digit 1 (MSD)

Digit 3

(LSD)

S = Sign Bit (1 = Negative)

S

S

(LSD)

(Always = 0)

ER

Operand

Result Base r

s (Power of 10)

ER = Error Bit (1 = Negative Operand)

(Always = 0)

200

305

306

4.

Enter the operand.

You can enter the operand from the keyboard of your industrial terminal or
through ladder diagram functions. Entry of operand 144 produces the number
12 when the square root function is completed. Figure 3.57 shows how the
operand and results are stored.

Figure 3.57

AF4 Square Root Function Format After Execution

17 16 15 14 13 12 11 10 7 6 5 4 3 2 1 0

Bit No.

Data Address

Result Address

D

E

E = Enable Bit (1 = Function in Progress)
D = Done Bit (1 = Function Complete)

11522

S = Sign Bit (1 = Negative)

S

S

ER

Operand

Result Base r

s (Power of 10)

ER = Error Bit (1 = Negative Operand)

200

305

306

1

4

4

1

2

0

0

0

1

(0)

(0)

(1)

(0)

Advertising