OnCWBindingDataUpdated

CNi

Function Group
OnCWBindingDataUpdated() Functions    Prev page: OnClickNext page: OnCWBindingStatusUpdated    
Function Declared in:
NiKnobEvents.h

'Declaration' icon -- Shortcut to top of page. Declaration

void OnCWBindingDataUpdated(
    short Index,
    LPDISPATCH Data,
    BOOL FAR* Ignore);

'Description' icon -- Shortcut to top of page. Description

Generated when the binding data is updated.

Notes:

1. 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.

2. Rather than waiting for this event, you might find it more convenient to check for new data. To determine if data has been updated since it was last read, query the value of the CNiBinding.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 CNiBinding.DataUpdatedEnabled property to false.

Shortcut to top of page. Parameters

short Index

Contains the index of the CNiBindings collection of the binding that generated this event.

LPDISPATCH Data

Used to construct a CNiDataSocketData object, which contains the new data.

BOOL FAR* Ignore

Ignores new data when set to true.

'See Also' icon -- Shortcut to top of page. See Also

Shortcut to top of page. Example

void OnCWBindingDataUpdated(short Index, LPDISPATCH Data, BOOL FAR* Ignore) {
   CWDataSocketData data(Data);
   if (data.Value < 0) {
       // Do not plot negative values--ignore them.
       ignore = true;
   }
   else {
       // Scale each value by a factor of 10.
       data.Value = data.Value * 10;
   }
}