What's the 3510 as the preset for the StrokeInputTmr?
Okay, thanks. Was the scan overhead the reason for using 3510 for the preset?
Why not provide an "most recent" SPM value and a "shift" SPM value? there's really no way to provide the kind of accuracy your customer is looking for.
I have tested rootboy's first suggestion and it works great. just make sure to reset your seconds and ticks count after each calculation at 5 strokes.
Thanks! But I'm curious, why reset it? I had my sample running for 1500+ strokes without any problem (on a Rockwell Logix5000 PLC).
You shouldn't have a problem unless you are limited by the size of your variable.
Oh, I see. But why use a 1 second timer? (unless you have to) I don't know anything about the Siemens PLC, but I would think that you could create a bigger timer.
All you are interested in with the timer is the accumulated time, so the larger the timer preset, the better off you will be.
My timer was set to nearly a million seconds, so I was in no danger of timing out the timer any time soon.
The timer preset I chose was completely arbitrary since the number of strokes that occurred during a given period would give you the correct STM value.
And it has the effect of being self averaging since over time any deviation in the stroke rate will get figured out (instantly) with the math.
In Siemens anything larger than a 1 second timer doesnt give you the time elapsed in milliseconds.