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: 

How to control two USB devices separately with one Program

Hello,

This is my first post in Labview discussion forums. I have Labview 2013 running in a system to which two Plantronics USB devices are connected. They are the same model numbered devices with different Serial numbers. The devices can be queried and controlled by a set of functions in a dll package. Currently I am using Labview's dll function caller to initiate a USB connection and send commands to the device and get responses, if only one device is connected.

If two devices are connected, I do not know how to route a command to a particular device. Right now, the USB connection is made to any one of them without any control.

Is there a way to control which USB device a connection can be opened based on Serial number?

Any pointers to resources of similar examples will be appreciated.

Thanks.

 

Krish.

0 Kudos
Message 1 of 3
(2,391 Views)

It may be that your DLL has a way to query for connected devices and return their serial numbers (it may be more than one step).  If it does, I would expect that there's some way to pick which of the two+ devices to send commands to.   What devices are you trying to control?  What DLL are you using?

 

If you haven't already, you might try to use the "import shared library" function in LV to create wrappers around the various DLL function calls and this might be more starightforward/intuitive than doing the calls directly using the call library function.  Sometimes looking at the same information in a different way can help.  Tools>>Import>>Shared Library and follow the prompts.  

0 Kudos
Message 2 of 3
(2,358 Views)

Can MAX "see" these devices?  If so, consider talking to them directly with LabVIEW, using whatever protocol (VISA, probably) they employ.  MAX will give the devices unique names (like "Dev1" and "Dev2"), and your code will have no trouble distinguishing between them (as you'll use an "I/O Wire" called "Dev1" or "Dev2", as appropriate).

 

Bob Schor

0 Kudos
Message 3 of 3
(2,289 Views)