PI AF Analyses for Pump On/Off (Pump Cycling)

I want to create a PI tag that counts how many times we are cycling our pumps at a daily and monthly interval, using Analyses.

 

The criteria for a "pump cycle", is it has zero flowrate and pump status = 'Off' for 3 minutes or longer. Attached is a picture of the current logic I created in PI AF.

 

However, the Analyses is not working as I expected, and I am getting really high values (hundreds of daily pump cycles, thousands of monthly pump cycles). I think it is likely because there is no stop trigger once the "pump cycle" condition has been met. Therefore, if a pump is off for an hour, it will count this as many pump cycles instead of one, since it meets the zero flowrate and pump status = 'Off' condition for the entire duration.

 

Does anyone have experience with creating a tag for a scenario like this? Or has suggestions on how to fix the logic.

 

Thanks

 


image.png

Parents
  • Hi

    Some pointers for you:

     

    1. In your CycleDetected expression you output to a PI Point attribute. To avoid confusion, this should be a separate analysis. I see you are differentiating between checking the analysis variable CycleDetected and the AF Attribute 'Cycle Detected' but in general, it's better to have it separate and always use the AF Attribute.
    2. I see you are attempting to assign values to CycleCount inside the CycleCounter expression. I don't believe this works, but if it does, it's not recommended. It's only the output attribute 'Cycle Counter' that should receive values from the CycleCounter expression
    3. In the Daily and Monthly counters you're uing the EventCount function, but this counts all events written to a tag - regardless of value. If you want to continue using this function, you need to make sure you count the right thing. See below!

    To use EventCount, you need to make sure you only output one of the conditions to your conditional expressions before. I'm not going into your actual business logic here, but once you have ensured you have a validated cycle, you should only output the 1's - not the 0's. Call it an event indicator, and output that to a PI Point attribute. Then you can count daily and monthly events using the EventCount function.

Reply
  • Hi

    Some pointers for you:

     

    1. In your CycleDetected expression you output to a PI Point attribute. To avoid confusion, this should be a separate analysis. I see you are differentiating between checking the analysis variable CycleDetected and the AF Attribute 'Cycle Detected' but in general, it's better to have it separate and always use the AF Attribute.
    2. I see you are attempting to assign values to CycleCount inside the CycleCounter expression. I don't believe this works, but if it does, it's not recommended. It's only the output attribute 'Cycle Counter' that should receive values from the CycleCounter expression
    3. In the Daily and Monthly counters you're uing the EventCount function, but this counts all events written to a tag - regardless of value. If you want to continue using this function, you need to make sure you count the right thing. See below!

    To use EventCount, you need to make sure you only output one of the conditions to your conditional expressions before. I'm not going into your actual business logic here, but once you have ensured you have a validated cycle, you should only output the 1's - not the 0's. Call it an event indicator, and output that to a PI Point attribute. Then you can count daily and monthly events using the EventCount function.

Children
No Data