LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA USB Control out function sends out a value of 0x00 in wIndex (Set_Report Request)

Hello,

I am setting up an automation system of a consumer audio device using LabView MAX. The audio device doesnot come with a LV USB driver. So I used the documents available in Labview to develop a NIMAX driver and set it up as USB RAW device.

This is also a HID device. I need to automate  a scenario where the Labview needs to send a "Device Status Query String" through the USB and receive the response from the device. I used a Beagle 480 USB tracer and HIDwrite application to manually send the byte string to the device and receive a response. Because it is a HID device, the USB tracer showed a Set_Report request control transfer as the mode of communication from the HidWrite to the device (Section 7.2.2 of Device Class Definition for HID Devices ).

The SetUp Tranaction packet from the tracer is as below,

------------------

 bmRequestType 0x21
bmRequestType.Recipient Interface (0b00001)
bmRequestType.Type Class (0b01)
bmRequestType.Direction Host-to-Device (0b0)
bRequest 0x09
wValue 0x0203
wIndex 0x0003
wLength 0x0021

-------------------------------------- 

I downloaded the USB RAW control example VI (because my device doesn't support bulk transfer) and loaded the same parameters in the control OUT option and ran it. I got the following error.

Error -1073807298 occurred at VISA USB Control Out in USB RAW - Control.vi. 

Possible reason(s):

VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error.

And the program stopped. 

I was running the USB trace in parallel. The SetUp Transaction packet went through with the following values,

---------------------------

bmRequestType 0x21
bmRequestType.Recipient Interface (0b00001)
bmRequestType.Type Class (0b01)
bmRequestType.Direction Host-to-Device (0b0)
bRequest 0x09
wValue 0x0203
wIndex 0x0000
wLength 0x0021

-----------------------------

The wIndex value goes out as 0x0000 even though I set the value to 0x0003. Any value set between 0x0001 to 0x00FF is sent as 0x0. But if I set it to 0x0100 then it is sent without any change (which I can't use because the device's interface is set to 0x03 when it was enumerated). Also the data packet after thesetup packet is terminated with a STALL packet. I guess it is because of the error in wIndex value.

Can anyone help me to understand what the issue. I am newbie to Labview and USB. I debugged as far as I could and researched in the groups and web but failed to get a explanation about this behavior.

I have attached the USB RAW Control out example VI initialised to my input parameters.

Thanks.

 

Krish.

 

 

0 Kudos
Message 1 of 6
(3,458 Views)
Why are using USB RAW instead of HID? That is the driver that the vendor supports. I'm not even sure that a HID driver can be replaced.
0 Kudos
Message 2 of 6
(3,448 Views)

Is there a way to communicate with a HID device other than USB raw in LV? 

In my case the NIMAX didnot recognise the device in the first place. So I followed the procedures in the document - USB Instrument Control Tutorial (http://www.ni.com/white-paper/4478/en/) - to install a VISA driver and proceeded with it. 

I am sorry if it didn't answer your question. 

Are you suggesting that I should have used HID.dll available in the Windows OS and used it's functions for USB communications? If so, can anyone suggest a good pointer about using hid.dll with labview. Even a small example will help.

Thanks.

0 Kudos
Message 3 of 6
(3,433 Views)
You can communicate with the hid.dll. It does not need to appear in MAX anymore than a mouse or keyboard needs to appear. That white paper should have big bold letters at the top that says 'Do not use unless all other attempts fail'. I've seen several posts on using hid such as https://decibel.ni.com/content/docs/DOC-19350 .
0 Kudos
Message 4 of 6
(3,417 Views)

I will try using Hid.dll. Thanks.

0 Kudos
Message 5 of 6
(3,377 Views)