beautypg.com

Programming chapter 3 – Rockwell Automation 1772-AF1,D17726.5.1 User Manual MINI-PLC-2/15 User Manual

Page 32

background image

Programming

Chapter 3

3Ć24

4.

Enter the value for the operand.

You can enter the value from the keyboard of your industrial terminal or
through ladder diagram functions. Entry of operand = 144 produces the result
12 when the square root function executes. Figure 3.20 shows how the result is
stored. The result is accurate to +0.01.

Figure 3.20

AF1 Square Root Function Format After Execution

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

S

4

4

Bit No.

Data Address

Operand

200

1

(0)

S

Result Address

Result

D

E

305

306

1

2

0

0

0

0

(0) (0) (1)

E = Enable Bit (1 = Function in Progress)

S = Sign Bit (1= Negative)

D = Done Bit (1 = Function Complete)

11584

Entry and Display of Input and Result Values

Figure 3.21 shows one method for inserting the input value and displaying the
input value and result of an AF1 square root. Although there are several
techniques for accomplishing this, we chose get instructions. The first rung
requests an AF1 square root function. The second rung shows the operand 144
in word 200 and the resultant square root 012.000 in words 305 and 306.

Figure 3.21

AF1 Square Root Function Input and Result Display Rungs

Bit

Storage

200

144

G

305

012

G

306

000

G

Execute Aux

Function

Function Number:
Data Addr:
Result Addr:

05

201
305