How can I calculate how many hours for a certain value, for example 8 means the machine is ON; 5 when the machine is OFF. So, how many hours has the value 8 occurs/present in 1 month?

How can I calculate how many hours for a certain value, for example 8 means the machine is ON; 5 when the machine is OFF. So, how many hours has the value 8 occurs/present in 1 month?

We have the TimeEQ('Attribute','StartTime','EndTime','Value') function to find the time a particular attribute stayed at the value.

Using this PE function would be helpful though the exact usage may be different per your PI Client type.