I am trying to monitor when a controller is out of operation. I have the controller tag that shows a trend of the controller status. The controller is operational if the value is 100 and off if the value is 0.

My goal is to record instances where the value is 0 and the corresponding duration. At the end of the day, I want to report that "Controller A" was shut down five times for a total of two hours.

Parents
  • Hello,

    It sounds like a use case for the TimeEq function for finding the duration of the shutdown. The analysis would be run periodically e.g. every day at 6:00 with start time being *-24h and end time being *. For the number of shutdowns within a given period two options came to my mind first:

    • Create another, event-triggered analysis with your tag being its trigger and it would check if the new value is 0 and if so, it would increment another tag serving as a counter. Then, the original "daily" function could use EventCount to count how many times it was increment within our period.
    • To avoid consuming additional tag for the counter, you use arrays by means of RecordedValues function getting all the values for your tag withinm the period. Then, use FilterData to leave only values of 0 in the array and finally ArrayLength to count the events that left in the array.

    Hope it helps!

     

Reply
  • Hello,

    It sounds like a use case for the TimeEq function for finding the duration of the shutdown. The analysis would be run periodically e.g. every day at 6:00 with start time being *-24h and end time being *. For the number of shutdowns within a given period two options came to my mind first:

    • Create another, event-triggered analysis with your tag being its trigger and it would check if the new value is 0 and if so, it would increment another tag serving as a counter. Then, the original "daily" function could use EventCount to count how many times it was increment within our period.
    • To avoid consuming additional tag for the counter, you use arrays by means of RecordedValues function getting all the values for your tag withinm the period. Then, use FilterData to leave only values of 0 in the array and finally ArrayLength to count the events that left in the array.

    Hope it helps!

     

Children
No Data