AnsweredAssumed Answered

GetMultiState Error in ProcessBook VBA

Question asked by chrise on Mar 29, 2017
Latest reply on Mar 29, 2017 by Marcos Vainer Loeff



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.