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

Page 43

Advertising
background image

Programming

Chapter 3

3Ć35

Error Messages

If you try to find the log of zero, the error bit is set and the result is zero.

AF4 Natural Log Functions

The AF4 natural log function finds the natural log of a 3-digit BCD integer to
the base e. The result is a 6-digit BCD value with an implied decimal point after
the most significant digit.

In (xxx.) - x.xx xxx

How to Enter an AF4 Natural Log Function

To program an AF4 natural log 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 31, the function number for the AF4 natural log function.

This entry identifies that the function entered is to perform an AF4 natural log
calculation and that the processor use the data table format shown in
Figure 3.31 when executed. The three digits of the operand (the number whose
natural log you want) and represented in BCD by the groups of bits labeled digit
1 through 3. The six digits of the result are labeled digit 1 through 6. A decimal
point is implied after the MSD.

Figure 3.31

General AF4 Natural Log 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

Operand

Digit 5

Result Address

n

Result

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

11501

Digit 3

(LSD)

Digit 3

Digit 1

(MSD)

Digit 4

Digit 6

(LSD)

ER = Error Bit (1 = Input is 0)

ER

3.

Enter a data address and a result address.

Advertising