AnsweredAssumed Answered

Button Click Multi-State value change

Question asked by alanR on Dec 4, 2017
Latest reply on Dec 6, 2017 by Kenji Hashimoto

Hi ,


Can someone give me an example of of how to create a processbook display that has a button which changes the value of a multi state tag. How would i code this in vb?

Im very new to vb so any help would be greatly appreciated.


My Code:

Option Explicit



Public section As String

Dim displayOpen As Boolean

Dim arrCells(1 To 5) As String

Dim WithEvents ctx As ContextHandler







Private Sub Display_BeforeClose(bCancelDefault As Boolean)



    ThisDisplay.Modified = False

End Sub



Private Sub Display_Open()



    Dim path As String

    Dim reference As String


    Dim vbProj As VBIDE.VBProject

    Dim chkRef As VBIDE.reference

    Dim vrDate As Variant

    Dim vrStatus As Variant

    Dim vrValue As Variant

    Dim trend As trend

    Dim FoundRef As Boolean




    displayOpen = True




    ComboBox1.AddItem "Section Average Voltage"

    ComboBox1.AddItem "Cell Average Voltage"


    vrValue = ThisDisplay.Symbols("valTrnd1MaxVal").GetValue(vrDate, vrStatus)


    Set trend = ThisDisplay.tndRefVoltage1

    trend.SetTraceScale 0, vrValue

    Set trend = ThisDisplay.tndRefVoltage2

    trend.SetTraceScale 0, vrValue







    'Set ctx = Application.ContextHandlers.Item("E")

    Set ctx = Application.ContextHandlers(1)


    displayOpen = False



End Sub