OnlineVariable.VariableBulkChange



VariableBulkChange(pvVars As Variant,pvPvIDs As Variant,pvValues As Variant,pvStatesLo As Variant,pvStatesHi As Variant,pvTimes As Variant)

Parameters

pvVars As Variant
Returns an array of variable objects
pvPvIDs As Variant
Returns an array of PvIDs of the changed variables.
pvValues As Variant
Returns the actual values as array
pvStatesLo As Variant
Returns the LoWords as array
pvStatesHi As Variant
Returns the HiWords as array
pvTimes As Variant
Returns the UpdateTimes as array
ED
not used
RT
avaliable

Remarks

Event is fired by changing the value of a variables.

Sample:


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

See Also

OnlineVariable