LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List all attached devices

Solved!
Go to solution

Hello,

I am currently developing a test program for a customer and I need to determine if the UUT is recognised and listed in device manager when attached to the PC via USB cable.

 

I have tried to use the SystemExec VI and call devcon.exe using the devcon find * command, but nothing is returned via the standard output string. I have since found out that this id due to it needing to run with administrative privileges.

 

I found an article where it was suggested that listing all attached devices could achieved using the Call Library Function and point it to C:\Windows\System32\devmgr.dll 

Unfortunately I'm not to sure what I am doing with the function and the article didn't really go into any depth of how it would be done.

 

Could anybody shed any light on how best to go about listing all attached devices. I didn't expect to be as difficult as it appears to be!

 

Thanks for looking,

 

Iain

 

0 Kudos
Message 1 of 9
(7,357 Views)

Play around with this:

"If you weren't supposed to push it, it wouldn't be a button."
Message 2 of 9
(7,308 Views)

If you are using it in LabVIEW, you may want to know if it is recognized as an attached device by MAX.  The following code works for DAQmx devices (including Simulated Devices), and there may also be similar Property Nodes that will enumerate Cameras (I haven't looked yet).

DAQmx System.png

Note the "Sample Answers" may be mis-leading -- I ran this on my machine, and Product Category, instead of returning an Enum (which I got by right-clicking and saying Create Constant) actually returns an I32.  Incidentally, this is by no means an exhaustive list of the available Properties, just some examples.

 

Bob Schor

0 Kudos
Message 3 of 9
(7,303 Views)

Hello Paul,

 

Thanks for reply!
I downloaded your library but unfortunately i cannot open it as it was created in a newer version of LabVIEW than I have. Would it be possible for you to upload a LabVIEW 2013 compatible version??

 

Many thanks

 

Iain

0 Kudos
Message 4 of 9
(7,286 Views)

Hello Bob!

 

I will have a play about with your example this morning and see how i get on.

Annoyingly i don't currently have a working device that i can prove it against as i have not yet been provided with one.

I'm working with the assumption that if i can detect that my phone has been connected by the device ID then the same should apply when the UUT is connected!

 

Thanks for your help, 

 

I'll let you know how i get on!

0 Kudos
Message 5 of 9
(7,284 Views)

here is the code you are looking for:

Benoit

0 Kudos
Message 6 of 9
(7,278 Views)
Solution
Accepted by topic author Goomba79

Hello all,

 

I have managed to get up and running using the following....

 find device.png

Iain

0 Kudos
Message 7 of 9
(7,276 Views)

Hello Benoit,

 

I've not played around with the .net functions.

I'll see if i can amend your code to report the device name as per my example i just uploaded.

when i run your VI the name description are reported as illustrated.USB_Scanner.png 

Cheers,

 

Iain

 

0 Kudos
Message 8 of 9
(7,271 Views)

hi ,

if change queryString to " Select * From Win32_PnPEntitystring",

How can i get the "string   HardwareID[];" in the USB Scanner.vi ??

 

HardwareID[]HardwareID[]

0 Kudos
Message 9 of 9
(6,075 Views)