Calculate percent runtime

Has anyone found a good way to calculate percent runtime? For example to calculate the percent time a boolean value was 1 vs 0. Not a true OEE calculation and not requiring schedules or any other considerations.

You could use a transaction group to log the boolean value on a set interval depending on the resolution you needed. Create a SQL query tag to count the number of records in the table, create another SQL query tag to count the number of records where the value is 1, and create an expression tag to calculate the percent runtime. Combine these tags into a UDT if you’re going to do this more than once.

What is the time period that you wanted to know the % runtime for? You could set the transaction group to delete records older than 24 hours, so you would always have a % runtime for the previous 24 hours. Log the % runtime expression tag for a historical record.