viVPrintf

Agilent VISA.NET

viVPrintf

Syntax

viVPrintf(ViSession vi, ViString writeFmt, ViVAList params);

Description

This function converts, formats, and sends params to the device as specified by the format string. This function is similar to viPrintf, except that the ViVAList parameters list provides the parameters rather than separate arg parameters. 

Using viVPrintf in Visual Basic 6

Some of viPrintf's variable arguments are references to primitive (byte, integer, long, float, etc.) types, meaning that the values themselves can be changed by the function.  There is no equivalent in VB6 for variable argument lists with reference arguments, so no direct translation is available.  Instead, use viVPrintf in conjunction with the undocumented VB6 VarPtr function to create an array of pointers to arguments than can be passed to the VISA functions. See viVPrintf/viVScanf Example using Stringfor sample VB6 code.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

writeFmt

IN

ViString

The format string to apply to parameters in ViVAList. See viPrintf for description.

params

IN

ViVAList

A list containing the variable number of parameters on which the format string is applied. The formatted data is written to the specified device.

Return Values

Type ViStatus

This is the function return status. It returns either a completion code or an error code as follows.

Completion Codes

Description

VI_SUCCESS

Parameters were successfully formatted.

Error Codes

Description

VI_ERROR_ALLOC

The system could not allocate a formatted I/O buffer because of insufficient resources.

VI_ERROR_INV_FMT

A format specifier in the writeFmt string is invalid.

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

The given session or object reference is invalid (both are the same value).

VI_ERROR_IO

Could not perform write function because of I/O error.

VI_ERROR_NSUP_FMT

A format specifier in the writeFmt string is not supported.

VI_ERROR_RSRC_LOCKED

Specified operation could not be performed because the resource identified by vi has been locked for this kind of access.

VI_ERROR_TMO

Timeout expired before write function completed.

See Also

viPrintf
viVPrintf/viVScanf Example using String