AnsweredAssumed Answered

Processbook VB update text with condition

Question asked by CarlosFelipe on Sep 5, 2017
Latest reply on Sep 5, 2017 by gmichaud-verreault

Hello, I need to set text of point tags value based on condition to be clear the Status in bulk, is there a less repetitive way to do it to several equipment's? Multi-state works as well, but will duplicate the need for get value from PI Data Archive.

 

Private Sub Display_DataUpdate()

Set server = PISDK.Servers.DefaultServer

Set pt1 = server.PIPoints("BOILER-01A")

Set pv1 = pt1.data.Snapshot

Set pt2 = server.PIPoints("BOILER-02A")

Set pv2 = pt2.data.Snapshot

If pv1 >= 30 Then

    Status01A.LineColor = pbGreen

    Status01A.Contents = Format("Operating")

Else

    Status01A.Contents = Format("Failure")

    Status01A.LineColor = pbRed

End If

If pv2 >= 30 Then

    Status02A.LineColor = pbGreen

    Status02A.Contents = Format("Operating")

Else

    Status02A.Contents = Format("Failure")

    Status02A.LineColor = pbRed

End If

... and so on.

End Sub

Outcomes