LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

usb control in

I am trying to receive data from an embedded controller that acts as a HID device, and sends mouse data to the computer via USB. I used the device driver wizard to create a VISA device so that I could perform USB raw reads. Everything seems to be working. I can open a session and use the USB Control In VI to get the status of the device, but I can't figure out how to get the data it is sending, or rather, how to get it to start sending data. There are 5 inputs to the USB Control in VI, and I can't seem to find a good description of them anywhere. Can anyone tell me how I might find out what these parameters mean? All I can find is how to check the status of a device. When I plug in the device, and let windows install a default driver automatically, it does take over the cursor, so I know it is capable of sending data.

0 Kudos
Message 1 of 8
(2,710 Views)

USB is a lot more complicated than serial or GPIB.

 

If you don't have a full USB protocol description from the manufacturer (all five of these inputs) then it's going to be very difficult to get anything going.

 

Shane

0 Kudos
Message 2 of 8
(2,706 Views)

I realize that USB is more complicated than serial, and others, but I can't see how it is the case that the only way I can communicate with a device is if I get command descriptions from the manufacturer. If that were the case, then how did Microsoft know what to put in their default driver? I can't imagine they called every manufacturer of every device to get the information. It seems there must be a standard they are all using.

 

Anyway, I got it to communicate using USB interrupts (not the USB Control in), but I still want to know how to use the USB control in, so if anyone has any info, it would appreciated. 

0 Kudos
Message 3 of 8
(2,684 Views)

You could search for "USB Nugget" in the forum and you'll find a nugget from me convering exactly that.

 

And YES, you DO need control codes for anything beyond the pre-defined basic USB commands.

 

There are pre-defined classes (like HID) whose basic behaviour is pre-defined beyond the ability to simply enumerate a device.  This is how microsoft, Linux and Mac knows what to do with a HID.  There's no secrets involved.  I suggest taking a glimpse at the USB 2.0 or 3.0 standard at www.usb.org.

 

Shane

0 Kudos
Message 4 of 8
(2,682 Views)

I did read the nugget, that's how I have gotten as far as I have (thanks!). I guess I wasn't clear, I only want to exercise the functionality of the things that are covered under in the HID class, which is what this device is recognized as (an HID mouse). I was hoping there was somewhere I could go besides the USB standard to learn about HID mouse communication, because the standard is a bit intimidating.

0 Kudos
Message 5 of 8
(2,677 Views)

Intimidating it is indeed.

 

There is a seperate HID specification on the same web page as I linked to, it's still got a lot in it but it's a bit easier to digest than the main USB spec itself.

 

Good luck.

 

Shane

0 Kudos
Message 6 of 8
(2,665 Views)

Just to clarify,

 

there is a set of standard commands which ALL USB devices need to support (Control Endpoint zero) .  These are all listed in Chapter 9 of the USB spec (Get Descriptor, Clear Endpoint and so on).

 

The HID spec adds a couple of extra commands for HIDs (Like Get Report).  These two sets of commands are basically all HIDs do.  If you can get those up and running, you essentially have HID capability.  It does get more complicated when you start to analyse the report data (The data is in the configuration descriptor but it's kinda hard to decipher automatically).

 

Shane.

0 Kudos
Message 7 of 8
(2,662 Views)

  

0 Kudos
Message 8 of 8
(2,280 Views)