Main Content

connectCallback

Add callback that responds to new data

Description

example

connectCallback(instrument_object,hCallback) adds a callback that responds to new data, which is available from the target computer. The eventData for the callback shares all the new data available from the target computer since the last time the callback was executed.

Examples

collapse all

Add a callback that responds to new data available from the target computer and stream that data to the real-time instrument object.

mldatxfile = 'slrt_ex_tank.mldatx';
hInst = slrealtime.Instrument(mldatxfile);
connectCallback(hInst,@my_callback);

Input Arguments

collapse all

To create the instrument object, use the Instrument function.

Example: hInst

The callback responds to new data becoming available for streaming.

Example: @my_callback

Introduced in R2020b