Is it possible to create a counter per shift where I have a tag that gives me a global accumulation eg. Bottles_per_production_day=45,032 but I want the bottles per shift
Shift 1 (5am-1pm)= 15,350 bottles
Shift 2 (1pm-9pm)= 16,480 bottles
Shift 3 (9pm-5am)= 13,202 bottles
and when another day passes it would reset to 0 each of the shifts to be able to start the accumulation again.
Is this possible?
Then make a trigger script on it to set the next counter to 0 when the shift changes. And use this value to determine what counter to increase (the details depend on what you use to count).
Consider using an odometer-style counter that never resets. Log its value to the database at any desired pace, or faster. Then subtract one value from any previous value for the production over that interval. Subtract the current value from any previous value for the live count since that sample.
But is it possible to make a counter per shift of an already existing tag to be able to show in real time the accumulation per shifts? In my case I have a tag that gives me the water usage in hectoliters for a specific order. I already put this to save in the database using transaction groups and I included my shifts and order number in the table. Would it be possible to achieve this by some sort of scripting or query tag?
We are just trying to get real time data while at the same time trying to store that specific value. In this case it would be the water consumption on a specified shift with a specified order/batch number.
You could run a query that sums the quantities for batches that finished within a particular shift, and add the live qty for the current shift. It gets tricky accounting for batches that start in one shift and end in a later shift.