L9P_AVER: Average Weighted Inputs Calculate
(Original Document)
Naming
Name in LL984 Editor
Function Block Name
name of legacy 984 instruction
name in other tools and editors like:
  • Type Library Browser
  • Data Editor
  • Animation Tables
  • Search Results
Function Description
The L9P_AVER DFB calculates the average of up to 4 weighted inputs.
Formula
Formula of the L9P_AVER DFB:
NOTE: The denominator of the formula in the Modsoft, ProWORX and Concept 984 documentation shows an addition of "1 +" instead of wk (for wk see table below). Block behavior in Control Expert is the same as in 984 controllers (formula as shown above).
The meaning of the elements:
Element
Meaning
In1 ... In4
inputs
k
constant
RES
result
w1 ... w4
weights
wk
weight
If Input Status Bit 9 (k is active) =1 then wk is 1, else it is 0.
Representation
Parameters
Input Pin
Name
Data Type
Address Range
Meaning
Top
ENABLE
ON = enables process control function
Node
Node Type
Name
Data Type
Address Range
Meaning
Middle
IN/OUT
PAR
ARRAY[1...24] OF UINT
%MW
see Parameter PAR below
Bottom
IN
LEN
UINT
24
length of parameter block (can not be changed)
Output Pin
Name
Data Type
Address Range
Meaning
Top
OUT
BOOL
ON = operation successful
Bottom
ERR
BOOL
ON = operation not successful
Parameter PAR
The data type of the parameter block is ARRAY[1...24] of UINT
Word
Content
Format
1, 2
reserved
DINT
3
output status
UINT
4
input status
UINT
5, 6
value of input1
REAL (Floating Point)
7, 8
value of input2
REAL (Floating Point)
9, 10
value of input3
REAL (Floating Point)
11, 12
value of input4
REAL (Floating Point)
13, 14
value of K (constant)
REAL (Floating Point)
15, 16
value of weighted input1 (wv1)
REAL (Floating Point)
17, 18
value of weighted input2 (wv2)
REAL (Floating Point)
19, 20
value of weighted input3 (wv3)
REAL (Floating Point)
21, 22
value of weighted input4 (wv4)
REAL (Floating Point)
23, 24
value of result (output)
REAL (Floating Point)
Output Status
Control Expert-IEC bits
Function
0...4
standard output bits (flags)
5
1 = result is a negative number
0 = result is a positive number
6
1 = no inputs activated
7...15
not used
Input Status
Control Expert-IEC bits
Function
0...6
not used
7
1 = k is active
8
1 = In1 and w1 are used
9
1 = In2 and w2 are used
10
1 = In3 and w3 are used
11
1 = In4 and w4 are used
12...15
standard input bits (flags)
A weight can be used only when its corresponding input is enabled, e.g. parameter words 21/22 (which contain the value of w4) can be used only when parameter words 11/12 (which contain In4) are enabled.