Hello, I a would like to create a rolling average for a flowmeter signal.
I'm quite new to Siemens Step 7 - does anyone have a FB or can paste in some code for me that they have used before?
All I would like:-
INPUTS
analogue in,
no of samples,
scan time,
OUTPUTS
Analogue averaged out
I assume that the block will fill up an array (the array size will vary depending on the no of samples size, the
Analogue averaged out will be the samples added together divided by no of samples.
I have looked on Siemens site and they have an average function but not rolling average so will always average all samples..
Thank you
Matt
ps this code exists for S2 plc but dont have the software/know if it is locked.
This Siemens 200 PLCs's file is going to create a rolling average for the last 100 scans worth of an analog input.
http://plc2u.com/index.php/plc-code/s7200/average-of-analog-input
can anyone open the file and paste contents?
I'm quite new to Siemens Step 7 - does anyone have a FB or can paste in some code for me that they have used before?
All I would like:-
INPUTS
analogue in,
no of samples,
scan time,
OUTPUTS
Analogue averaged out
I assume that the block will fill up an array (the array size will vary depending on the no of samples size, the
Analogue averaged out will be the samples added together divided by no of samples.
I have looked on Siemens site and they have an average function but not rolling average so will always average all samples..
Thank you
Matt
ps this code exists for S2 plc but dont have the software/know if it is locked.
This Siemens 200 PLCs's file is going to create a rolling average for the last 100 scans worth of an analog input.
http://plc2u.com/index.php/plc-code/s7200/average-of-analog-input
can anyone open the file and paste contents?
Last edited: