could use DT to keep a "long term" average
I had a situation recently where I needed to measure something that changed very slowly. An oil level than went down about 1 mm per hour. I needed it to drop several mm in order to make accurate readings as the level inicator had a resolution of 12 mm.
If I had better instruments it would have been easier, and better but then it would cost to much.
There were so many issues with this one measurement, I will skip to the part I think might be of use here.
I started reading the level in the tanl every so many seconds/minutes/hours, depending on the rate of expected consumption.
Then after each measurement I used a function that writes the number in the first row of a DT and shifts all the others down one.
(I am away from the software right now, do not have the number of the FB but it makes so many things easier. If you want I can find it and post later.)
We know how many entries are in the DT of course, we made it. I used 10. Then , as the DT fills up with data, I have a history, and I know at what interval the different readings were taken.
The next rung looks at one of the DT entries and when this entry is not zero it subtracts the first entry from this one. Since I know the elapsed time, I now have how much has changed in X time.
In my case I had one scenario where I could not take a reading until the unit had run for 24 hours. But I wanted the data to update more frequently.
I made this table take a reading every hour.
After the first 24 hours, I had a new 24 hour average every hour.
You case is just the opposite, but you could count cans per time interval and write them to the DT , using differnet starting points on the datatable, you can dissplay the count in the first minute and then move your average as more data becomes available or have different dissplays for different time periods.
Some people like to have the daily average, hourly, average, and real time for example.
You could also use 3 DTs.
I took a reading every minute in one and every hour in another and every 24 hours in a third. Each has its own merits.
You could read cans and every Xseconds take a reading.
After the first minute or so, do your math and dissplay the average speed.
For "real time" count seconds between each can as suggested above, No DT needed.
I went on to chart the running averages to give a graphical history of the data.
S7 can do so much and there are so many ways to get similar results. half the fun is exploring different ways to do the same thing.