4 Replies Latest reply on Mar 29, 2017 6:59 PM by Marcos Vainer Loeff

    GetMultiState Error in ProcessBook VBA




      I get an error with this line of code. I am trying to get an alert when a process variable drifts from a set point


      Private Sub Value1_DataUpdate()
      ' Updates state multi-state boundaries when value 1 changes

      Dim L, H As Double
      Dim MS As MultiState

      Set MS = ThisDisplay.Symbols.Item(1).GetMultiState  ' (THIS IS WHERE THE ERROR OCCURS)

      L = ThisDisplay.Value1.GetValue(Now, good) 'get low value
      H = ThisDisplay.Value3.GetValue(Now, good) 'get high value

      If (L < 25) Then L = 25 'check against multistate tag zero
      If (H > 75) Then H = 75 'check against multistate tag zero+span

      MS.DefineState 1, 25, L 'update multi-state variable
      MS.DefineState 2, L, H
      MS.DefineState 3, H, 75
      End Sub




      Message was edited by: Rick Davin.  Changed title.