CWBindingDataUpdated Event

Measurement Studio User Interface

CWBindingDataUpdated Event

Syntax

Sub ControlName_CWBindingDataUpdated( Index As Integer, Data As CWData, Ignore As Boolean)

Applies To

CWButton

CWGraph

CWKnob

CWNumEdit

CWSlide

Purpose

Generated when the binding data is updated.

Remarks

The control generates a CWBindingDataUpdated event when it receives updated data. The event passes a reference to the data, so you can modify it in the event. For example, you can change the value of the updated data or even ignore it.

Rather than waiting for this event, you can check for new data. To determine if data has been updated since it was last read, query the value of the CWBinding.DataUpdated property. When a new value is loaded, DataUpdated is set to True. After the DataUpdated property is queried, DataUpdated reverts to False.

Use the DataUpdated property to check for updates if you are not using events or if you have set the CWBinding.DataUpdatedEnabled property to False.

Parameters

Index As Integer

Index in the CWBinding collection of the binding that generated this event.

Data As CWData

CWData object containing new data. You can modify this parameter to change the new data.

Ignore As Boolean

Ignores new data when set to True.

Example

Private Sub CWGraph1_CWBindingDataUpdated(ByVal Index As Integer, ByVal Data As CWUIControlsLib.CWData, Ignore As Boolean)
  If (Data.Value < 0) Then
     'Don't plot negative values--ignore them
     Ignore = True
  Else
     'Scale each value by a factor of 10
     Data.Value = Data.Value * 10
  End If
End Sub

See Also

CWBindings

CWBinding

CWData

CWBinding.DataUpdatedEnabled

CWBinding.DataUpdated