09-11-2018 09:18 AM
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
Solved! Go to Solution.
09-11-2018 02:24 PM
Play around with this:
09-11-2018 02:47 PM
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).
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
09-12-2018 02:09 AM
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
09-12-2018 02:14 AM
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!
09-12-2018 02:50 AM
here is the code you are looking for:
Benoit
09-12-2018 02:56 AM - edited 09-12-2018 03:12 AM
Hello all,
I have managed to get up and running using the following....
Iain
09-12-2018 03:11 AM
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.
Cheers,
Iain
07-02-2020 04:26 AM
hi ,
if change queryString to " Select * From Win32_PnPEntitystring",
How can i get the "string HardwareID[];" in the USB Scanner.vi ??