807
Data Control Instructions Section 3-18
binary value of 0000 to 0FA0 for an Analog Output Unit. When CIO 000000
turns ON in the following example, the contents of D00000 is scaled using the
linear function defined by
∆X (0200), ∆Y (0FA0), and the offset (0). These val-
ues are contained in D00100 to D00102. The sign of the BCD value in
D00000 is indicated by the Carry Flag. The result is output to CIO 2011.
3-18-10AVERAGE: AVG(195)
Purpose Calculates the average value of an input word for the specified number of
cycles.
Ladder Symbol
Variations
Applicable Program Areas
Operands N: Number of Cycles
The number of cycles must be between 0001 and 0040 hexadecimal (0 to 64
cycles).
R: Result Word and R+1: First Work Area Word
R will contain the average value after the specified number of cycles. R+1 pro-
vides information on the averaging process and R+2 to R+N+1 contain the
previous values of S as shown in the following diagram.
∆X (0200)
∆Y
∆X
P1
R
Offset
Contents of R (2011, signed binary)
∆Y (0FA0 Hex)
Contents of S (D00000, signed BCD)
Max. conversion
Min. conversion
P1:
P1+1:
P1+2:
P1+3:
P1+4:
S
N
R
AVG(195)
S: Source word
N: Number of cycles
R: Result word
R+1: First work area word
Variations Executed Each Cycle for ON Condition AVG(195)
Executed Once for Upward Differentiation Not supported.
Executed Once for Downward Differentiation Not supported.
Immediate Refreshing Specification Not supported.
Block program
areas
Step program
areas
Subroutines Interrupt tasks
Not allowed OK OK OK