viBufWrite

Agilent VISA.NET

viBufWrite

Syntax

viBufWrite(ViSession vi, ViBuf buf, ViUInt32 count, ViPUInt32 retCount);

Description

Similar to viWrite, except the data is written to the formatted I/O write buffer rather than directly to the device. This operation is similar to viWrite and does not perform any kind of data formatting. It differs from viWrite in that the data is written to the formatted I/O write buffer (the same buffer as used by viPrintf and related operations) rather than directly to the device. This operation can intermix with the viPrintf operation, but mixing it with the viWrite operation is  discouraged.

If you pass VI_NULL as the retCount parameter to the viBufWrite operation, the number of bytes transferred will not be returned. This may be useful if it is important to know only whether the operation succeeded or failed.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

buf

IN

ViBuf

Represents the location of a data block to be sent to the device.

count

IN

ViUInt32

Number of bytes to be written.

retCount

OUT

ViPUInt32

Represents the location of an integer that will be set to the number of bytes actually transferred.

Special Values for retCount Parameter

Value

 

 

Action Description

VI_NULL

 

 

Do not return the number of bytes transferred.

Return Values

Type ViStatus

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

Completion Code

Description

VI_SUCCESS

Operation completed successfully.

Error Codes

Description

VI_ERROR_INV_SESSION
VI_ERROR_INV_OBJECT

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

VI_ERROR_INV_SETUP

Unable to start write operation because setup is invalid (due to attributes being set to an inconsistent state).

VI_ERROR_IO

An unknown I/O error occurred during transfer.

VI_ERROR_NSUP_OPER

The given vi does not support this function.

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 function completed.

See Also

viWrite, viBufRead