Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

USB HID Device LabWindows Communication

Hello!

 

I'm working on creating a system that will consist of a computer communicating with up to 10 different devices that communicate using USB HID. We will be making multiple duplicate systems, and I'm looking for the best way to approach the communication.

 

At first, I followed the information in this article:

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x1qzCAA&l=en-US

 

After following the instructions followed by some trial and error with the VISA Driver Wizard and Device Manager, I was able to get a device enumerating in Device Manager under "NI-VISA USB Devices" and was able to write a simple program in LabWindows that used the VISA interface to find it and open a session with the device.

 

However, if I connect another device to the computer (same Vendor ID and Product ID but different serial number), it enumerates as a standard HID device instead of under "NI-VISA USB Devices".

I also noticed that when the article indicated that a "PNF" was supposed to be created, the file wasn't being created. When I looked into this issue, thinking it was related, I found these articles indicating that VISA has some problems with USB HID devices due to the way Windows handles HID devices:

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019MD4SAM&l=en-US
http://digital.ni.com/public.nsf/allkb/EA2A99F90D5E84EE86256F400064FF7D 

 

Even if I'm able to repeat the steps for each device, since there will be multiple systems (and each system will have 10 devices) going through the VISA Driver Wizard / Device Manager for each one would add a lot of complication and time. I'm also concerned that any future changes / debugging efforts could potentially require going through the whole process again.

 

So, I've been investigating alternate ways of approaching the communication (such as dynamically linking to the standard hid.dll), but each approach has had some dificulties along the way.

 

My question is: What's the recommended approach for communicating with USB HID devices with LabWindows?

0 Kudos
Message 1 of 3
(5,216 Views)

Hey Chris,

 

I found one example program that communicates with USB HID devices with inputs of Vendor ID and Product ID. It may be worth looking into to see how this person implemented his program. He has included some contact informaion, and it may be worth reaching out to see if he has any insight.

 

I'm not sure how the program will behave if you have not configured the driver through the wizard, and you may end up having to configure each device. 

0 Kudos
Message 2 of 3
(5,127 Views)

Hey Daniel,

 

Thanks for pointing out that example. It looks like this example takes the same approach that I ended up using - dynamically linking to the standard hid.dll, rather than going through VISA. While the VISA API was easier to use (and might be more portable?), this approach doesn't require any special VISA driver.

0 Kudos
Message 3 of 3
(5,106 Views)