User`s guide

Programming with VISA 3
Agilent VISA User’s Guide 43
Sending I/O Commands
This section provides guidelines for sending I/O commands,
including:
Types of I/O
Using Formatted I/O
Using Non- Formatted I/O
Types of I/O
Once you have established a communications session with a
device, you can start communicating with that device using
VISA's I/O routines. VISA provides both formatted and
non- formatted I/O routines.
•Formatted I/O converts mixed types of data under the
control of a format string. The data is buffered, thus
optimizing interface traffic.
Non- formatted I/O sends or receives raw data to or from
a device. With non- formatted I/O, no format or conversion
of the data is performed. Thus, if formatted data is
required, it must be done by the user.
You can choose between VISA's formatted and non- formatted
I/O routines. However, you should not mix formatted I/O
and non- formatted I/O in the same session. See the
following sections for descriptions and code samples using
formatted I/O and non- formatted I/O in VISA.
Using Formatted I/O
The VISA formatted I/O mechanism is similar to the C stdio
mechanism. The VISA formatted I/O functions are viPrintf,
viQueryf, and viScanf. There are also two non- buffered and
non- formatted I/O functions that synchronously transfer
data, called viRead and viWrite, and two that
asynchronously transfer data, called viReadAsync and
viWriteAsync.