User`s guide

Programming with VISA 3
Agilent VISA User’s Guide 45
Formatted I/O Conversion
The formatted I/O functions convert data under the control
of the format string. The format string specifies how the
argument is converted before it is input or output. The
format specifier sequence consists of a % (percent) followed
by an optional modifier(s), followed by a format code.
%[modifiers]format code
(See Table 11, “Descriptions of Format Codes,” on page 46.)
Zero or more modifiers may be used to change the meaning
of the format code. Modifiers are only used when sending or
receiving formatted I/O. To send formatted I/O, the asterisk
(*) can be used to indicate that the number is taken from
the next argument.
However, when the asterisk is used when receiving
formatted I/O, it indicates that the assignment is suppressed
and the parameter is discarded. Use the pound sign (#)
when receiving formatted I/O to indicate that an extra
argument is used. The following are supported modifiers. See
the viPrintf function in the VISA Online Help for additional
enhanced modifiers (@1, @2, @3, @H, @Q, or @B).
Field Width Field width is an optional integer that
specifies how many characters are in the field. If the
viPrintf or viQueryf (writeFmt) formatted data has fewer
characters than specified in the field width, it will be
padded on the left, or on the right if the – flag is present.
You can use an asterisk (*) in place of the integer in
viPrintf or viQueryf (writeFmt) to indicate that the
integer is taken from the next argument. For the viScanf
or viQueryf (readFmt) functions, you can use a # sign to
indicate that the next argument is a reference to the field
width.
The field width modifier is only supported with viPrintf
and viQueryf (writeFmt) format codes d, f, s, and
viScanf and viQueryf (readFmt) format codes c, s, and [].
(See Table 11 for a description of format codes.)