User`s guide
20 Agilent VISA User’s Guide
2 Building a VISA Application in Windows
VISA cannot call back to a VB function. Thus, you can only
use the VI_QUEUE mechanism in viEnableEvent. There is
no way to install a VISA event handler in VB.
VISA functions that take a variable number of parameters
(viPrintf, viScanf, viQueryf) are not callable from VB.
Use the corresponding viVPrintf, viVScanf and
viVQueryf functions instead.
You cannot pass variables of type Variant to VISA functions.
If you attempt this, the Visual Basic program will probably
crash with a 'General Protection Fault' or an 'Access
Violation.'
Format Conversion Commands
The functions viVPrintf, viVscanf and viVqueryf can
be called from VB, but there are restrictions on the format
conversions that can be used. Only one format conversion
command can be specified in a format string (a format
conversion command begins with the % character).
For example, the following is invalid:
status = viVPrintf(vi, "%lf%d" + Chr$(10),
...)
Instead, you must make one call for each format conversion
command, as shown in the following example:
status = viVPrintf(vi, "%lf" + Chr$(10),
dbl_value)
status = viVPrintf(vi, "%d" + Chr$(10),
int_value)
Numeric Arrays
When reading from or writing to a numeric array, you must
specify the first element of a numeric array as the params
parameter. This passes the address of the first array element
to the function. For example, the following code declares an
array of 50 floating point numbers and then calls
viVPrintf to write from the array.