viSPrintf

Agilent VISA.NET

viSPrintf

Syntax

viSPrintf(ViSession vi, ViPBuf buf, ViString writeFmt, arg1, arg2, ...);

Description

Same as viPrintf, except the data are written to a user-specified buffer rather than the device. This operation is similar to viPrintf, except that the output is not written to the device, but is written to the user-specified buffer. This output buffer will be NULL terminated.

If the viSPrintf operations outputs an END indicator before all the arguments are satisfied, the rest of the writeFmt string will be ignored and the buffer string will still be terminated by a NULL.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

buf

OUT

ViPBuf

Buffer where data are to be written.

writeFmt

IN

ViString

String describing the format for arguments.

arg1, arg2

IN

N/A

A list containing the variable number of parameters on which the format string is applied. The formatted data are 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 system 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_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.

See Also

viPrintf