AnsweredAssumed Answered

Resetting multistate blink

Question asked by ByronJCoughlin on Jul 21, 2015
Latest reply on Jul 28, 2015 by Rhys Kirk

I have a processbook display with multiple alarms. Each alarm consists of a rectangle and a button. The rectangle has a multi-state associated with it. State 2's blink box is checked. When the alarm comes in for state 2 the operator can click the alarms button. This action calls VBA code that acknowledges the alarm. The onClick code stops the blinking by clearing the multi-state state 2 checkbox.


Sub onClickAlarmButton()

    Dim sym As Symbol

    Dim ms As MultiState

    Dim mss As MSState


    If (ThisDisplay.Button1.Selected = True) Then

        changeState ("alarm1")

    ElseIf (ThisDisplay.Button2.Selected = True) Then

        changeState ("alarm2")

    ElseIf (ThisDisplay.Button3.Selected = True) Then

        changeState ("alarm3")

    End If

End Sub


Sub changeState(alarm As String)

    Set sym = ThisDisplay.Symbols(alarm)

    Set ms = sym.GetMultiState

    Set mss = ms.GetState(2)

    mss.Blink = False

End Sub


After the pi tag resets to state 1 I would like for the blink checkbox in state 2 to become checked again. My question is how can I trigger a function when the state changes from 2 to 1.