How to get working Hours base on Boolean status

I know there is an Hours meter on the transaction group, but I need to know how I can show the working hours in SCADA page,
we have a washing system that washes something for 10 minutes or less this machine working 12 hours or 13 hours per day, we need to know how many hours operations put the machine in washing mode

we have Boolean and I added Boolean to the transaction group, the question is how I can show working Hours on SCADA pages? How we can use transaction group result

Hi @jamshidzade

Have you got solution your question?

Actually I have similar kind of requirement where I want to record the duration of our machines towerlights status. Like when the batch started, how much time (in minutes) the machine is currently on the Green Light (running state), or on the Red Light (fault state) or on the Yellow light (standby/stopped by the operator).

As, this duration will help me in the OEE calculation.

1 Like

Use a transaction group that has an on-change trigger for the boolean or integer of interest. Have the transaction group check the trigger as a pace that meets your accuracy requirements. Then query the database, using a LEAD() window function to look forward from an event to grab the timestamp of the next one. Use an outer query to compute the durations grouped by event value, discarding the grouped rows that aren't interesting.

The insertions into the database can also be scripted if the SQL Bridge module is not installed/licensed.

There are numerous topics on this forum with sample SQL to convert events into durations. Some of these, perhaps:

https://forum.inductiveautomation.com/search?q=%20lead%20downtime%20order%3Alatest

Also, @Shaheryar_Ahmad, you asked this question in another topic:

1 Like

I use a UDT with three tags, tag A is the cumulative time, tag B is the last Up time, and the tag C is the current state. Then update A, B in C's value change script.
I only have perspective and historian modules. (and drivers)

1 Like