viBufRead

Agilent VISA.NET

viBufRead

Syntax

 viBufRead(ViSession vi, ViPBuf buf, ViUInt32 count, ViPUInt32 retCount);

Description

Similar to viRead, except that the operation uses the formatted I/O read buffer for holding data read from the device. This operation is similar to viRead and does not perform any kind of data formatting. It differs from viRead in that the data is read from the formatted I/O read buffer (the same buffer as used by viScanf and related operations) rather than directly from the device. This operation can intermix with the viScanf operation, but use with the viRead operation is discouraged.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

buf

OUT

ViPBuf

Represents the location of a buffer to receive data from the device.

count

IN

ViUInt32

Number of bytes to be read.

retCount

OUT

ViPUInt32

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

Special Value 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 Codes

Description

VI_SUCCESS

The operation completed successfully and the END indicator was received (for interfaces that have END indicators).

VI_SUCCESS_MAX_CNT

The number of bytes read is equal to count

VI_SUCCESS_TERM_CHAR

The specified termination character was read.

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_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, viScanf