Ok guys, I hope I make myself clear when asking this. I am looking to calculate the speed that a product if moving through a machine. And put that speed on a panelview.
We are using an encoder to measure the distance. So I could start a timer, and at time 1 sec copy the encoder count somewhere, and do the same at time 5 seconds and calculate the speed by using speed = distance/time.
And I believe that would work, except I was wondering if it would be possible to have a rolling number. So for example when the timer reaches 6 seconds, I use the encoder count from time 2 seconds and 6 seconds, to calculate my speed, and keep doing it that way so the panelview keeps being updated every second.
How would I go about doing that? or is there an easier way that I havent thought of?
I will be using an AB PLC 5. Thanks guys
We are using an encoder to measure the distance. So I could start a timer, and at time 1 sec copy the encoder count somewhere, and do the same at time 5 seconds and calculate the speed by using speed = distance/time.
And I believe that would work, except I was wondering if it would be possible to have a rolling number. So for example when the timer reaches 6 seconds, I use the encoder count from time 2 seconds and 6 seconds, to calculate my speed, and keep doing it that way so the panelview keeps being updated every second.
How would I go about doing that? or is there an easier way that I havent thought of?
I will be using an AB PLC 5. Thanks guys