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

Programming
Chapter 3
3Ć43
Entry and Display of Input and Result Values
Figure 3.42 shows one method for inserting the input values and displaying
input values and result of an AF4 power function. Although there are several
techniques for accomplishing this, we chose get instructions.
The first rung requests the AF4 to evaluate a power function. The top branch of
the second rung contains the input base, 124, in word 200 and the input
exponent 02.0 in word 201. The lower branch of rung 2 contains the result,
1.53(10
4
) in the form of result base (153) in word 300 and result exponent (004)
in word 301. The implied decimal points in the result base and result exponent
are after digits 1 and 3 respectively.
Figure 3.42
AF4 Power Function Input and Result Rungs
201
124
G
300
153
G
301
004
G
020
G
200
Bit
Storage
Execute Aux
Function
Function Number:
Data Addr:
Result Addr:
300
33
200
Error Message
If you input a negative number for the input base y, the absolute value of y is
used and the error bit is set.
If yx >9.99(10)
099
, the error bit is set, and a result of zero is returned.
AF4 Reciprocal Function
The AF4 reciprocal function finds the value of the reciprocal of a 6-digit BCD
number and presents the result in a 6-digit BCD number.
1 = +.xxx xxx
+xxx xxx.
If you try to find the reciprocal of +1, the result will read .999 999 with the
appropriate sign.