User`s guide
Programming with VISA 3
Agilent VISA User’s Guide 55
viWrite. The viWrite function synchronously sends the
data pointed to by buf to the device specified by vi. Only
one synchronous write operation can occur at any one
time.
viWrite(vi, buf, count, retCount);
viReadAsync. The viReadAsync function asynchronously
reads raw data from the session specified by the vi
parameter and stores the results in the location where buf
is pointing. This operation normally returns before the
transfer terminates. Thus, the operation returns jobId,
which you can use with either viTerminate to abort the
operation or with an I/O completion event to identify
which asynchronous read operation completed.
viReadAsync(vi, buf, count, jobId);
viWriteAsync. The viWriteAsync function asynchronously
sends the data pointed to by buf to the device specified
by vi.
This operation normally returns before the transfer
terminates. Thus, the operation returns jobId, which you
can use with either viTerminate to abort the operation or
with an I/O completion event to identify which
asynchronous write operation completed.
viWriteAsync(vi, buf, count, jobId);
Sample: Using Non-Formatted I/O Functions
This sample program illustrates using non- formatted I/O
functions to communicate with a GPIB device. This sample
program is intended to show specific VISA functionality and
does not include error trapping. Error trapping, however, is
good programming practice and is recommended in your
VISA applications. See “Trapping Errors” in this chapter for
more information.
/*nonfmtio.c
This example program measures the AC voltage on
a multimeter and prints the results. You may
need to change the device address. */