Event driven reading, simple data types
Method: AdsReadVarConnectEx
Sample:
PLC declaration:
TCtoLV_boolVal AT%MX0.0: BOOL;
A callback VI is registered for the event AdsReadConnectUpdateEx.
The method AdsReadVarConnectEx establishes a fixed connection between LabVIEW™ and a PLC variable. The returned handle identifies the connection. When the connection is no longer needed, it is disconnected using AdsDisconnectEx.
The data is transferred as a variant when the callback VI is called. Using the handle, the variables can be converted to the correct type and assigned to the correct LabVIEW™ global variable.