LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to identify a USB dongle on my PC or on another PC on the (same) web

Hi all,

 

I need to check if a USB dongle is currently connected to my PC or was pulled out.

The dongle might be connected to another PC on my web and then I need to check the same in remote mode. That is, check that it is still connected to the other PC from my PC.

I tried to implement this with the "Find.vi" from the System VIs group (see attached VIs), but it seems that it doesn't recognize my dongle.anks

 

Any ideas why is my USB dongle not recognized by the System VIs?

Any ideas how to implement it differently?

 

Note: My LV version is 2011.

 

I'd be gratefull for any idea...

 

Thanks,

Mentos.

0 Kudos
Message 1 of 6
(14,427 Views)

It's likely that your device doesn't communicate the same way the Find Hardware VI would expect. This is usually used to find NI devices on the system. (Someone else might chime in and say otherwise, but this is how I've always used it.)

 

With USB (serial) communication, there's a little more work you need to do because your device has to have a device driver installed to function with your computer, so the system can't just automatically see it without knowing a little more information.

 

Do you have a set of commands that you know the device will respond to if queried? You could use the VISA Find Resource native to list all ports that are connected, then send commands and read responses from the ports found. Another option is to set up the baud rate on the device, so that it's the only device on the system with that baud rate, so you know that you've found your device if the specific baud rate matches.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


0 Kudos
Message 2 of 6
(14,342 Views)
You'll only find USBTMC, virtual com ports, NI USB devices, or devices you use the VISA Wizard to create a driver for. Is your dongle one of those? If not, why do you think all USB would be listed? Is your mouse or keyboard listed? Is a memory stick? Without any information on this dongle, impossible to say how it is enumerated. What does Windows device manager say?
0 Kudos
Message 3 of 6
(14,319 Views)

Hello James and Dennis,

 

Thank you for the reply.

I do understand your explanations.

 

Let me add some more details:

My dongle serves as a license key for an application.

The dongle itself is bought from a third party so, in response to James suggestions, I do not have a set of commands for it.

For the same reason, I don't want to play with its baud rate.

The Visa Find Resource.vi also can not find it.

 

I noticed that there are some recommendations on the forum to use Devcon.

I know that's an option (at least for detecting the dongle on my local PC), but I wouldn't like to use it since I'll have to install it on every PC where my application is installed and that's not so convenient.

 

I tried to use the Devmgr.dll, inputing my USB Device Instance Path (see attached picture). It does detect my dongle, but there are 2 problems:

1. It displays the device manager GUI when run and waits for response. This is not good for my application. I can't have any pop ups.

2. The Device instance Path I read from my dongles is a bit different for each dongle, so there's no constant value I can put in my code.

 

Assuming I just need to detect the dongle on my LOCAL PC for now, is there any other dll I can use (Kernel ?) ???

Any other option to do this (without installing an additional application)?

 

Thanks,

Mentos.

0 Kudos
Message 4 of 6
(14,283 Views)

Usually the dongle manufacturers have drivers for the dongle that include code for checking.  It is most likely a DLL call.

 

If they support a network search, then they probably have code examples for that as well.  If not, then you will have to have your check app installed on the PC with the dongle and then communcate with your main program to convey its there.

 

I would check out the dongle manufacturer's website or talk to someone there to find out how the recommend you check the dongle.

0 Kudos
Message 5 of 6
(14,273 Views)

Any one done something with WinUSB.dll ???

0 Kudos
Message 6 of 6
(14,223 Views)