Products & Services Solutions Academia Support User Community Company

Learn more about OPC Toolbox   

cancelasync - Cancel asynchronous read and write operations

Syntax

cancelasync(GObj)
cancelasync(GObj,TransID)

Description

cancelasync(GObj) cancels all asynchronous read or write operations that are in progress for the group object specified by GObj. Note that this function is asynchronous and does not block the MATLAB command line.

After cancelasync cancels the in-progress asynchronous operations, the OPC server generates a cancel async event. If you specify an M-file callback for the CancelAsyncFcn property, the callback function executes when this event occurs.

cancelasync(GObj,TransID) cancels the asynchronous operation(s), specified by the transaction ID(s) given by TransID. You can cancel specific asynchronous requests using this syntax.

Examples

Create a connected client, group, and items:

da = opcda('localhost', 'Matrikon.OPC.Simulation');
connect(da);
grp = addgroup(da, 'CancelAsyncEx');
additem(grp, {'Random.Real8', 'Random.Real4'});

Request an asynchronous read operation and then immediately cancel that request:

tid = readasync(grp); cancelasync(grp, tid)

See Also

readasync | writeasync

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS