viUsbControlOut

NI-VISA

viUsbControlOut

Purpose

Performs a USB control pipe transfer to the device.

Note  This operation is intended only for users familiar with the USB protocol.

C Syntax

ViStatus viUsbControlOut (ViSession vi, ViInt16 bmRequestType, ViInt16 bRequest, ViUInt16 wValue, ViUInt16 wIndex, ViUInt16 wLength, ViPBuf buf);

Visual Basic Syntax

viUsbControlOut& (ByVal vi&, ByVal bmRequestType%, ByVal bRequest%, ByVal wValue%, ByVal wIndex%, ByVal wLength%, buf As Byte)

Resource Classes

USB INSTR, USB RAW

Parameters

Name Direction Description

vi

IN

Unique logical identifier to a session.

bmRequestType

IN

The bmRequestType parameter of the setup stage of a USB control transfer. Refer to the USB specification for further details.

bRequest

IN

The bRequest parameter of the setup stage of a USB control transfer.

wValue

IN

The wValue parameter of the setup stage of a USB control transfer.

wIndex

IN

The wIndex parameter of the setup stage of a USB control transfer. This is usually the index of the interface or endpoint.

wLength

IN

The wLength parameter of the setup stage of a USB control transfer. This value also specifies the size of the data buffer that contains the data to send in the optional data stage of the control transfer.

buf

IN

The data buffer that sends the data in the optional data stage of the control transfer. This is ignored if wLength is 0.

Return Values

Error Codes Description

VI_ERROR_INV_OBJECT

The given session reference is invalid.

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

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_CONN_LOST

The I/O connection for the given session has been lost.

VI_ERROR_INV_PARAMETER

The value of some parameter—which parameter is not known—is invalid.

VI_ERROR_INV_MASK

The bmRequestType parameter contains an invalid mask.

Description

The viUsbControlOut() operation synchronously performs a USB control pipe transfer to the device. The values of the data payload in the setup stage of the control transfer are taken as parameters and include bmRequestType, bRequest, wValue, wIndex, and wLength. An optional data buffer buf contains the data to send if a data stage is required for this transfer. Only one USB control pipe transfer operation can occur at any one time.

Related Topics

INSTR Resource

RAW Resource

VI_ATTR_USB_CTRL_PIPE

viUsbControlIn