Production info in tags

Hi, i have the following situation, i have a blower which has some of the following tags in s7 400

Time since last reset
Machine rotation time since last reset.
Good Bottles since last reset.
bad bottles since last reset.
and more but same situation.

currently we are resetting the information from the HMi from the blower. which keeps a record of the period and the information, and resets the counters to 0.

right now we use it per run, so we run a orange soda when we finished the operator finished the run and a new run starts.

what i would like to do is the following.

keep record of not only the run, but by shift, day or anyway i would like to do it.

so i have the tags created in ignition and can see the values. i don’t really know how to separte this values since last reset to a shift or day values. since the problem is that when it restarts a run it would clear everything.

ideally it would be to have a

Shift start time
shift Machine rotation time
shift Good Bottles.
shift bad bottles
and so on.

so im not really sure how to create a tag or tags to keep this memory. anybody help would be aprpeciated im really stuck in this and need this to calculate. production efficiency per shift, per day, or per date range. so far the way i have it i can only calculate per reset.
when they press the push button i recoed the values in a transaction group, if succes, i then set the value in the plc to actually reset the counters to 0. but this is only per run. and i can have a run that can go more than 1 shift. and sometimes i have many runs in one shift.

Thank you

Create a boolean tag in the plc called ReadyToLog or some such.
Set the boolean to true on completion of a production run.
Then create a Transaction Group in Ignition that is triggered by that boolean being true, and stores the values to a database table.
The Transaction group then resets the boolean to false after logging the values.

Thanks i know how to trigger the group and how to record that is not the problem i’m having.

the problems is to be able to separte a per shift, per run, per hour, or day values.

Don’t reset the counters. Treat them as odometers. Record regularly (as often as you might need to report). Use lag() window functions in SQL to generate deltas from the last entry in a time period to the last entry in the previous time period. Include a modulus function to catch odometer rollover.

1 Like

Or if you are recording to a database look into how to use the GROUP BY clause in queries to summarize data by date ranges.

thank you, not really sure how to create this if you could give me an example would be great

Got it to work on creating 3 tags. for what i wanted. which is not great but works correctly.

so i made
Current Tag Value from PLC
Saved Tag Memory Tag
FinalTotal Expression Tag. Current+saved.

I record. Final to Sql every one second, and update final also every one second.

when operator reset plc HMI. i move final to save, then clear current, and star counting again.

this way i don’t have to modify the HMI for the blower which i don’t have the source code for the Sidel Machine. and i treat the finaltotal as an odometer.

so thanks for the help. i got some good ideas.