|
ED
|
not used
|
RT
|
avaliable
|
Event is fired by changing the value of a variables.
Dim WithEvents zOLV As OnlineVariable Dim strVariables() As String Private Sub Project_Active() Dim i As Integer 'create array of variable names ReDim strVariables(thisProject.Variables.Count) For i = 0 To thisProject.Variables.Count - 1 strVariables(i) = thisProject.Variables.Item(i).Name Next i 'get/create onlinevariable - container Set zOLV = thisProject.OnlineVariables.Item("myOLV") If zOLV Is Nothing Then Set zOLV = thisProject.OnlineVariables.CreateOnlineVariables("myOLV") End If 'add variables as bulk to online - container zOLV.AddBulk strVariables() 'activate BULK Mode zOLV.ActivateBulkMode 'activate VariableChange - Event zOLV.Define End Sub Private Sub zOLV_VariableBulkChange(pvVars As Variant, pvPvIDs As Variant, pvValues As Variant, pvStatesLo As Variant, pvStatesHi As Variant, pvTimes As Variant) Dim i As Integer Debug.Print "Changed Variables: " & UBound(pvVars) For i = 0 To UBound(pvVars) Debug.Print " - [" & pvPvIDs(i) & "] " & pvVars(i).Name & " = " & pvValues(i) Next i Debug.Print "----------------------------------------------------------------" End Sub Private Sub Project_Inactive() 'free objects If Not zOLV Is Nothing Then zOLV.Undefine End If thisProject.OnlineVariables.DeleteOnlineVariables ("myOLV") Set zOLV = Nothing End Sub