viVxiCommandQuery

Agilent VISA.NET

viVxiCommandQuery

Syntax

viVxiCommandQuery(ViSession vi, ViUInt16 mode, ViUInt32 cmd, ViPUInt32 response);

Description

Send the device a miscellaneous command or query and/or retrieve the response to a previous query. This operation can send a command or query or receive a response to a query previously sent to the device. The mode parameter specifies whether to issue a command and/or retrieve a response, and what type or size of command and/or response to use.

If the mode parameter specifies sending a 16-bit command, the upper half of the cmd parameter is ignored. If the mode parameter specifies just retrieving a response, the cmd parameter is ignored. If the mode parameter specifies sending a command only, the response parameter is ignored and may be VI_NULL. If a response is retrieved but is only a 16-bit value, the upper half of the response parameter will be set to 0.

Refer to the VXI Specification for defined word serial commands. The command values Byte Available, Byte Request, Clear, and Trigger are not valid for this operation.

Parameters

Name

Dir

Type

Description

vi

IN

ViSession

Unique logical identifier to a session.

mode

IN

ViUInt16

Specifies whether to issue a command and/or retrieve a response. See the Description section for actual values.

cmd

IN

ViUInt32

The miscellaneous command to send.

response

OUT

ViPUInt32

The response retrieved from the device. If the mode specifies sending a command, this parameter may be VI_NULL.

Special Values for mode Parameter

mode

 

 

Action Description

VI_VXI_CMD16

 

 

Send 16-bit Word Serial command.

VI_VXI_CMD16_RESP16

 

 

Send 16-bit Word Serial query, get 16-bit response.

VI_VXI_CMD32*

 

 

Send 32-bit Word Serial command.

VI_VXI_CMD32_RESP16*

 

 

Send 32-bit Word Serial query, get 16-bit response.

VI_VXI_CMD32_RESP32*

 

 

Send 32-bit Word Serial query, get 32-bit response.

VI_VXI_RESP16*

 

 

Get 16-bit response from previous query.

VI_VXI_RESP32*

 

 

Get 32-bit response from previous query.

* Not supported in Agilent VISA

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

Operation completed successfully.

Error Codes

Description

VI_ERROR_BERR

Bus error occurred during transfer.

VI_ERROR_INP_PROT_VIOL

Device reported an input protocol error occurred during transfer.

VI_ERROR_INV_MODE

The value specified by the mode parameter 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_OPER

The given vi does not support this function.

VI_ERROR_OUTP_PROT_VIOL

Device reported an output protocol error occurred during transfer.

VI_ERROR_RAW_RD_PROT_VIOL

Violation of raw read protocol occurred during transfer.

VI_ERROR_RAW_WR_PROT_VIOL

Violation of raw write protocol occurred during transfer.

VI_ERROR_RESP_PENDING

A previous response is still pending, causing a multiple query error.

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

INSTR Resource Description