AverageCh (FB)¶
FUNCTION_BLOCK AverageCh
Short Descritpion¶
Creation of a mean of up to six weighted numerical input sizesTypical application: Creation of a room temperature average from different sensors
Portrayal¶
Interfaces¶
Inputs¶
Name Datatype
Range
Init-Value
Function
rIn1 REAL Analog value input 1
rIn2 REAL Analog value input 2
rIn3 REAL Analog value input 3
rIn4 REAL Analog value input 4
rIn5 REAL Analog value input 5
rIn6 REAL Analog value input 6
xEn1 BOOL Enable analog value input 1
xEn2 BOOL Enable analog value input 2
xEn3 BOOL Enable analog value input 3
xEn4 BOOL Enable analog value input 4
xEn5 BOOL Enable analog value input 5
xEn6 BOOL Enable analog value input 6
Outputs¶
Name Datatype
Range
Init-Value
Function
rOut REAL Mean value
xErr BOOL Collective fault
Setpoints/parameters¶
Name Datatype
Range
Init-Value
Function
iLoading6 INT 10 Weighting - analog value input 6
iLoading5 INT 10 Weighting - analog value input 5
iLoading4 INT 10 Weighting - analog value input 4
iLoading3 INT 10 Weighting - analog value input 3
iLoading2 INT 10 Weighting - analog value input 2
iLoading1 INT 10 Weighting - analog value input 1
Functional Description¶
Mean value rOut¶
Collective fault xErr¶
Visualization¶
Information¶
Element Authors
Date
Version Information
Function
Adam Bartod 07.2016 1.0 Initial version
Programming
Adam Bartod 07.2016 1.0 Initial version
Test Alexander Halter 07.2016 1.0 Initial version
Documentation
Jochen Reu 11.2017 1.0 Initial version
Codesys¶
- InOut:
Scope Name Type Initial Comment Input rIn1 REAL Analog value input 1
rIn2 REAL Analog value input 2
rIn3 REAL Analog value input 3
rIn4 REAL Analog value input 4
rIn5 REAL Analog value input 5
rIn6 REAL Analog value input 6
xEn1 BOOL Enable analog value input 1
xEn2 BOOL Enable analog value input 2
xEn3 BOOL Enable analog value input 3
xEn4 BOOL Enable analog value input 4
xEn5 BOOL Enable analog value input 5
xEn6 BOOL Enable analog value input 6
iLoading6 INT 10 Weighting - analog value input 6
iLoading5 INT 10 Weighting - analog value input 5
iLoading4 INT 10 Weighting - analog value input 4
iLoading3 INT 10 Weighting - analog value input 3
iLoading2 INT 10 Weighting - analog value input 2
iLoading1 INT 10 Weighting - analog value input 1
Output rOut REAL Mean value
xErr BOOL Collective fault