Instrument Control Toolbox | ![]() ![]() |
Stop asynchronous read and write operations
Syntax
Arguments
obj |
An instrument object or an array of instrument objects. |
Description
stopasync(obj)
stops any asynchronous read or write operation that is in progress for obj
.
Remarks
You can write data asynchronously using the fprintf
or fwrite
functions. You can read data asynchronously using the readasync
function, or by configuring the ReadAsyncMode
property to continuous
(
serial port, TCP/IP, UDP, and VISA-serial objects). In-progress asynchronous operations are indicated by the TransferStatus
property.
If obj
is an array of instrument objects and one of the objects cannot be stopped, the remaining objects in the array are stopped and a warning is returned. After an object stops,
TransferStatus
property is configured to idle
.
ReadAsyncMode
property is configured to manual
(serial port, TCP/IP, UDP, and VISA-serial objects).
Data in the input buffer is not flushed. You can return this data to the MATLAB workspace using any of the synchronous read functions. If you execute the readasync
function, or configure the ReadAsyncMode
property to continuous
, then the new data is appended to the existing data in the input buffer.
Functions
Properties
![]() | spoll | tcpip | ![]() |