Read data asynchronously from group or items
TransID = readasync(GObj)
TransID = readasync(IObj)
TransID = readasync(GObj) and
= readasync(IObj) asynchronously read data for all the
items contained in the
or for the vector of
daitem objects specified by
TransID is a unique transaction ID
for the asynchronous request.
For asynchronous reads, data is always read from the device, not from the server
Active property is ignored for asynchronous
When the read operation completes, a read async event is generated by the server.
If a callback function file is specified for the
property, that function executes when the event is generated.
You can cancel an in-progress asynchronous request using
Configure a client, group, and item, for the Matrikon™ Simulation Server:
da = opcda('localhost','Matrikon.OPC.Simulation'); connect(da); grp = addgroup(da,'ExReadAsync'); grp.UpdateRate = 20; itm = additem(grp,'Random.Real8');
Perform two asynchronous read operations:
tid1 = readasync(grp) tid2 = readasync(grp,'device')
Examine the event log:
pause(2) disp('Event log:') showopcevents(da)