Count seconds since start with reset condition and use the value within vision

Hi together,

I want to count the seconds since shift start (daily 6am / 2pm / 10 pm).

My thought was using a transaction group with a tag and hour meter and use a variable that changes its value 6am/2pm/10pm to reset the hour meter (reset condition).Do I have to constantly query the database for the stored value of the hour meter or is there a possibility to grab the value directly from the transaction group tag?

Or is there another simpler possibility to count seconds since starting timestamp to use this value in vision? I want to multiply the value of seconds with the production rate per minute to get a theoretical production value (target production).

Thanks in advance!

You can use a gateway scheduled script to read a starting timestamp tag, and calculate the seconds past and other logic at your specific times.

now = system.date.now()
system.date.secondsBetween(startTime,now)

Or if you want more of a real time progress you could use an expression tag using your start tag.

secondsBetween({[.]start},now())

which can be used in a gateway scheduled script, transaction group, or another expression tag.

1 Like