Step 7 FC for averaging analog values
Step 7 FC for averaging analog values
(OP)
Does anybody know if there is a pre-written FC used for averaging a group of analog values on a continual basis?
I have an application where I have qty. 12, 4-20mA signals being input to the PLC (CPU 313C). I need to compare each of the values to the average of them all on a continuous basis.
I am using this as a feedback system to synchronize 12 machines by momentarily shutting off flow control valves if one machine is running faster than the average (by a predetermined amount).
I have an application where I have qty. 12, 4-20mA signals being input to the PLC (CPU 313C). I need to compare each of the values to the average of them all on a continuous basis.
I am using this as a feedback system to synchronize 12 machines by momentarily shutting off flow control valves if one machine is running faster than the average (by a predetermined amount).





RE: Step 7 FC for averaging analog values
CODE
ITD //addresses or symbols
//-------------
L input2
ITD
+D
//-------------
//part between dashed lines to be repeated
//until you use all inputs
L 12
/D
T average //here is your average
Regards,
Jacek
Do it right or don't do it at all.