AnsweredAssumed Answered

Start a timer for a tag when it is below a certain value

Question asked by Mitch87 on Jul 25, 2017
Latest reply on Jul 26, 2017 by GreenTech

Hi guys,

 

 

I have the below code to generate an alert when a PI tag value dips below a certain value, it works the way it is but I want to add a timer into the code, so I want the alert to generate if the tag has been below X value for Y time. Can anyone help me out? :-)

 

Public Sub EffluentAlert()
If EffluentFlow < 500 Then
        If EffluentAlarm Then
        answer = MsgBox("Effluent Has Been Off > 12 Hours, Notify XXXX, VVVV and YYYY!", 16, "Attention")
        EffluentAlarm = False
        End If
Else
    If Not EffluentAlarm Then
        If EffluentFlow > 75 Then
            EffluentAlarm = True
        End If
  
    End If
End If
End Sub

Outcomes