Count When Tag1 > Tag2 at Daily & Monthly Intervals

I am wanting to count how many times vibration alarms and shutdowns are triggered using PI AF Analyses:

'Vibration' > 'Vibration High Alarm'

'Vibration' > 'Vibration High High Shutdown'

 

Both 'Vibration High Alarm' and 'Vibration High High Shutdown' are static values.

 

I currently have the following analysis set up (this is for 'Vibration' > 'Vibration High Alarm') scenario:

 

High Alarm Trigger

If 'Vibration Value' >= 'Vibration High Alarm Setpoint'

Then 1

Else 0

 

High Alarm Trigger Count (Daily)

EventCount('High Alarm Trigger', 't', '*')

 

High Alarm Trigger Count (Monthly)

If (Hour('*')=0 And Day('*')=1)

Then EventCount('High Alarm Trigger', '*-1mo', '*')

Else EventCount('High Alarm Trigger', BOM('*'), '*')

 

Would using a 'counter' and TagTot be a better alternative than using EventCount? I can't seem to find a way using EventCount to only count when High Alarm Trigger is 1 and not 0.

Parents
  • Hi again

    Yes, you could use TagTot but make sure you use the overload method with six parameters, where the last parameter needs to be 'EventWeighted'.

    But I'd rather recommend changing your High Alarm Trigger to this, then the rest will work just fine:

     

    High Alarm Trigger

    If 'Vibration Value' >= 'Vibration High Alarm Setpoint'

    Then 1

    Else NoOutput()

     

    As mentioned earlier, EventCount counts all events written to a tag, regardless of value. So make sure you only output the events you want to count Slight smile

Reply
  • Hi again

    Yes, you could use TagTot but make sure you use the overload method with six parameters, where the last parameter needs to be 'EventWeighted'.

    But I'd rather recommend changing your High Alarm Trigger to this, then the rest will work just fine:

     

    High Alarm Trigger

    If 'Vibration Value' >= 'Vibration High Alarm Setpoint'

    Then 1

    Else NoOutput()

     

    As mentioned earlier, EventCount counts all events written to a tag, regardless of value. So make sure you only output the events you want to count Slight smile

Children
No Data