From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Nugget: 2 of n : USB Control transfers using VISA

Hi Shane,

Well i cam back and read in detail. Al I am capable of saying at this time is that this is a Nugget who's day is yet to come. There will come a time when we point at this Nugget as often as we cite the "Simple Serial Read" example.

Give us time. We'll catch-up to you.  Smiley Wink

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 11 of 36
(4,304 Views)

In one of the very first posts, there was a comment that this Nugget was going to concentrate on non-compound devices.  Is there one that exists on USB compound devices with multiple Interfaces?  I have tried running a VI that requests the device descriptor of my USB mouse (compound device with 2 interfaces) and I am getting the blue screen of death on windows.

0 Kudos
Message 12 of 36
(4,040 Views)

Unfortunately no.

 

I personally still have no experience with compound devices.  Initial testing failed miserably and I don't have time to go after it at the moment.

 

I thought you already had some success with interfacing with your mouse from THIS post.

 

Are you running into other problems than mentioned in your other post?

 

 Onething I've NEVER had with VISA is a Blue screen.

 

Shane.

Message Edited by Intaris on 05-08-2009 02:20 PM
Message 13 of 36
(4,028 Views)

Hi Intaris,

 

Yes, I had some success in interfacing with the device but that is only through the interrupt In end point.  I am now trying to perform control transfers to the device but for certain requests such as Get Descriptor, I get a blue screen.  I am using the example VI called USB Raw-Control.vi and when I get the Device Descriptor of the compound device, I am getting blue screens.  Odd behavior.

0 Kudos
Message 14 of 36
(4,022 Views)
No problem at all using VISA to output to my USB microchip board. It outputs a command easily enough using the VISA write. But I have had no success at all getting the VISA USB Control In or out to work and VISA read just errors back saying I have not set it up properly. I am using 8.2. Am I committing some sort of silly?
0 Kudos
Message 15 of 36
(3,817 Views)

Hey Fred,

 

Since you are having no problems in sending commands through the VISA write, I have to assume you have done that USB driver wizard process correctly in labview so that rules out that possibility (also I think you would get a different error).  I am not USB guru or anything but it could be the way you have the Visa Control In/Out setup.  I had the same error as you at one point but I found that I was using the wrong Index value (normally I use 0 but for my device, I had to use index 1).  It all depends on how your USB board is setup on the protocol level.  Setting the correct request type, index number, request number, value, etc is all dependant on how your USB FW is written. 

 

Are you able to send Control In/Out commands using something other than the VISA method?  If you can, you can do a USB trace (I used a Beagle USB "snooper") to see exactly what is going on on the USB line.  This is how I found out the correct values to wire into my USB VISA IN/OUT function.  From there, I just input the correct data command buffer (for USB Control OUT) to send what commands I wanted to send.  As for USB Control IN, it was fairly simple since you are only reading data out from your device.

 

I know I did not provide you an actual solution but more of a process to get you there since I do not have the USB protocol information for your USB microchip board.

0 Kudos
Message 16 of 36
(3,815 Views)

The "normal" Visa read and write use Bulk transfers for USB RAW devices, so the problem could well be the setup packet for your control transfer.  That had ME stuck for quite a while.

 

Can you post a picture of the code so that we can see what you're doing?  Can you tell us exactly what values you're inputting to the Control VIs?

 

Shane.

0 Kudos
Message 17 of 36
(3,803 Views)

A simple labview VISA write works fine. But the VISA read after a write requesting data is "unable to start, setup invalid". Using the command in and out, I get the command in to read only if I use a default request and the correct(?) length for the input. (Or perhaps this just works for two byte structures and nothing else?)

Request 0, Type 80, value & index 0, length 2 obtains 10 (in V8 array.) The control output with 0,0,0,0,length 2 and some data in the control output buffer, says, Some parameter is invalid.The programs consist of the stand alone VI with a user array of the VI's input and output values. Except for USBRawControl which is from the NI examples on the web here.

 

So I have the impression that somehow Visa write works fine, and pipes in what I write to it. Visa read either can't be used or requires some setup I have flummoxed. The Visa USB command out seems to work, but either does not or cannot take inputs from my micro, and the output just does not work at all.

0 Kudos
Message 18 of 36
(3,765 Views)
Would you know how to send data through an interrupt transfer?
0 Kudos
Message 19 of 36
(3,127 Views)
Started a new thread here
0 Kudos
Message 20 of 36
(3,101 Views)