beautypg.com

Programming chapter 3, Af1 average function format after execution – Rockwell Automation 1772-AF1,D17726.5.1 User Manual MINI-PLC-2/15 User Manual

Page 36

background image

Programming

Chapter 3

3Ć28

Figure 3.24

AF1 Average Function Format After Execution

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

S

Bit No.

Word

Input 1

S

Result Address

Result

D

E

11587

ER

Input 2

Input 3

Number of Inputs

0

0

3

200

201

202

203

305

306

(0)

S

(0)

S

(0)

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

4

1

3

2

3

5

1

2

1

2

5

6

3

3

3

Data

Address

Entry and Display of Input and Result Values

Figure 3.25 shows one method you can use to enter values and display results of
an AF1 average function. although there are several techniques for
accomplishing this, we chose get instructions. The first rung requests an AF1
average function. The top branch of the second rung shows the number of
values to be averaged, 003, in word 200. It also shows the numbers to be
averaged in words 201, 202, and 203. The lower branch of the second rung
shows the resultant average as 256.333 in words 305 and 306.

Figure 3.25

AF1 Average Function Input and Result Display Rungs

Bit

Storage

203

121

G

202

235

G

201

413

G

200

003

G

305

256

G

306

333

G

Execute Aux

Function

Function Number:
Data Addr:
Result Addr:

06

201
305