Rockwell Automation 1772-AF4,D17726.5.3 User Manual, AUX FUNCT PROM User Manual

Page 61

Advertising
background image

Programming

Chapter 3

3Ć53

AF4 Square Root Function

The AF4 square root function operates on a 3-digit BCD integer and gives the
result in terms of a base number 4 and a power of 10, s, by which the base
number is multiplied to obtain the resultant square root value. The equation is:

+X

1/2

= r(10)

s

where:

x = XXX.

r = resultant base number = X.XXX

s = the exponent of 10 = x

How to Enter an AF4 Square Root Function

To program an AF4 square root 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 37, the function number for an AF4 square root function.

This entry identifies that the function entered is to perform an AF4 square root
calculation and that the processor use the data table format shown in
Figure 3.55 when executed.

Figure 3.55

General AF4 Square Root Function Word and Digit Format

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

m

Digit 2

Digit 2

Result Address

n

D

E

n + 1

E = Enable Bit (1 = Function in Progress)

D = Done Bit (1 = Function Complete)
MSD = Most Significant Digit

LSD = Least Significant Digit

11520

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)

Advertising