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 check if USB is plugged into computer/device manager?

I need to write a code in Labview and then implement into TestStand which checks a device which is plugged into a USB port. Check if it is plugged it or not. Then if it is, be able to call it to turn on when its called. 

Either checking the com ports or looking into device manager. Im not too sure who to begin with this.

0 Kudos
Message 1 of 7
(4,145 Views)

If the USB device is exposed as a Virtual COM Port then something along these lines might help as a starting point: http://digital.ni.com/public.nsf/allkb/FA9073730B255BE586256E54005B13C4.

0 Kudos
Message 2 of 7
(4,117 Views)

If the device is viewable in MAX (for example, a USB-6009 may show up as "Dev1", with a product type "USB-6009", you can use the DAQmx System "DevNames" properties to enumerate all of the DAQmx devices, then query the array of DevNames (using the DAQmx Device property) to get its Product Type (e.g. "USB-6009") and, if you want, its DevSerialNumber (useful if you have a calibrated or specific Device you want to use).  When you find the device you want, you'll have a DAQmx Device Reference.

 

Bob Schor

0 Kudos
Message 3 of 7
(4,109 Views)

Can you give me a sample code, I have jut started labview and a bit confused about what your trying to get through

0 Kudos
Message 4 of 7
(4,106 Views)

First question -- do you know about MAX (the Measurement and Automation eXplorer)?  It should appear on your desktop as its own Icon (looking like a stylized "N").  Have you opened it and looked at it?

 

If you are just starting out in LabVIEW, Property Nodes may be a little "rich" for you.  Have you been introduced to DAQmx in your class?  If you open a Block Diagram (open LabVIEW, type ^N to open a new VI, type ^E to open its (blank) Block Diagram), you can right-click and choose Measurement I/O (just below the Function Palettes), and NI DAQmx should be the first item present.  If it is not, you do not have Device Drivers installed, and can't use USB devices.  Explore this palette.  Learn about DAQmx.  Do a Web Search for "Learn 10 Functions in NI-DAQmx" and read this excellent White Paper.

 

Bob Schor

0 Kudos
Message 5 of 7
(4,103 Views)

Yes I do have it and have just read the document Learn 10 Functions in NI-DAQmx. Now how do I implement which DAQ to correctly use and implementing the USB port to identify if it is actually connected and to launch it. This is the confusing part for me

0 Kudos
Message 6 of 7
(4,070 Views)

To further up, I am not using a NI device. So I dont think DAQmx will be useful. I think VISA could read USB devices but do not know how to implement it in order to check if the USB is there and then open it up

0 Kudos
Message 7 of 7
(4,058 Views)