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

Page 63

Advertising
background image

Programming

Chapter 3

3Ć55

Entry and Display of Input and Result Values

Figure 3.58 shows one method for inserting input values and displaying input
values and the results of AF4 square root computations. Although there are
several techniques for accomplishing this, we chose get instructions.

The first rung requests the AF4 square root function. The second rung displays
in word 200 the number 144, whose square root is desired. It also shows the
resulting square root (12) in the form of 1.20 in word 305 and in word 306 it
shows the power of 10,001, by which 1.2 must be multiplied to obtain
(1.2)(10)

001

= 12.

Figure 3.58

AF4 Square Root Function Input and Result Display Rungs

G

305

G

306

001

G

200

144

120

Bit

Storage

Execute Aux

Function

Function Number:
Data Addr:
Result Addr:

305

37

200

Error Message

If you try to find the square root of a negative number, the error bit is set and
the absolute value of the input number is used.

Advertising