User`s guide
54 Agilent VISA User’s Guide
3 Programming with VISA
/* Initialize device */
viPrintf(vi, "*RST\n");
/* Set up device and send a comma-separated
list */
viPrintf(vi, "CALC:DBM:REF 50\n");
viPrintf(vi, "MEAS:VOLT:AC? %,2f\n", list);
/* Read results */
viScanf(vi, "%lf", &res);
/* Print results */
printf("Measurement Results: %lf\n", res);
/* Close session */
viClose(vi);
viClose(defaultRM);
}
Using Non-Formatted I/O
There are two non- buffered, non- formatted I/O functions
that synchronously transfer data called viRead and viWrite.
Also, there are two non- formatted I/O functions that
asynchronously transfer data called viReadAsync and
viWriteAsync. These are raw I/O functions and do not
intermix with the formatted I/O functions.
Non-Formatted I/O Functions
The non- formatted I/O functions follow. For more
information, see the viRead, viWrite, viReadAsync,
viWriteAsync, and viTerminate functions in the VISA Online
Help.
viRead. The viRead function synchronously reads raw
data from the session specified by the vi parameter and
stores the results in the location where buf is pointing.
Only one synchronous read operation can occur at any
one time.
viRead(vi, buf, count, retCount);