AnsweredAssumed Answered

How make pop-up using VBA in pdi??

Question asked by Peres on Jul 31, 2017
Latest reply on Aug 2, 2017 by Kenji Hashimoto

When alarm is true (vr=0) i need show pop-up so i made this.....

 

 

Private Sub Value241_DataUpdate()

    Dim vr As Variant

    Dim vrDate As Variant

    Dim vrStatus As Variant

    Dim dateTime As Variant

 

    If enabledPopupValue241 = True Then

        If flagValue241 = False Then

            prevTimeValue241 = Date

            prevTimeValue241 = prevTimeValue241 + TimeValue("00:00:00")

            freqAlarmValue241 = Date + TimeValue("01:00:00")

        End If

       

        vr = Value241.GetValue(vrDate, vrStatus)

       

        dateTime = Date

        dateTime = dateTime + (vrDate - freqAlarmValue241)

   

        If vr = 0 And dateTime >= prevTimeValue241 Then

            PlayWAV

            prevTimeValue241 = vrDate

            MsgBox "[" & Now & "] Detecção de alarme na linha flexível do poço SPH-16 do FPSO CIB devido: Delta P no choke ultrapassou o limite mínimo estabelecido"

            flagValue241 = True

        End If

    End If

 

End Sub

 

 

But i need delay 1 minute, for show pop-up the alarm is true during all 1 minute. How make this??

Outcomes