beautypg.com

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

Page 40

background image

Programming

Chapter 3

3Ć32

Figure 3.28

AF1 Standard Deviation Function Format After Execution

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

Bit No.

Word

Input 1

S

Result Address

Result

D

E

11589

ER

Input 2

Input 3

Number of Inputs

0 0 3 200

201

202

203

305

306

(0) (0) (1) (0)

2

0

0

2

0

1

2

0

2

0

0

0

8

1

6

Data

Address

E = Enable Bit (1 = Function in Progress)

S = Sign Bit (1 = Negative)

D = Done Bit (1 = Function Complete)

ER = Error Bit (Set if number of inputs = 0)

Entry and Display of Input and Result Values

Figure 3.29 shows one method you can use to enter values and display results of
an AF1 standard deviation function. Although there are several techniques for
accomplishing this, we chose the instructions. The first rung requests an AF1
standard deviation function. The top branch of the second rung shows the
number of values whose standard deviation is sought, 003, in word 200. it also
shows the three numbers involved in words 201, 202, and 203. The lower
branch of the second rung shows the resulting standard deviation as 000.816 in
words 305 and 306.

Error Message

If you insert a zero for the number of values whose standard deviation is sought,
the error bit (bit 14) is set and the result reads zero.