LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Detecting USB Break Event

I am looking for a means of detecting a USB device being connected or disconnected as an event ot be handled in my program.  I have seen previous examples where the break was registered as a User Event but cant seem to find it.  Does anyone have an example of how to detect a USB device being disconnected via event handling?

0 Kudos
Message 1 of 4
(3,306 Views)

Hello, thanks for posting to the NI forums.

 

If the USB device you are talking about is a serial communicator via USB what you are looking for is the "Detect Break Event" in the Labview example finder. This is good for the USB-485/2, USB-232/4 etc.

 

If this is a DAQ card communicating via USB the DAQmx device Property node will give you access to pull some information from each device you have connected, also you can use the system Hardware property node to pull information as Vendor Name, Product Name, etc. 

 

Found couple of examples that can guide you on your application, one of them is good if you want LabVIEW to execute different secctions of code depending on the device connected to the computer, 

 

Detect Hardware to execute specific LabVIEW code

 

The other example that can help you out uses window registry key to determine the usb device conection. 


Check if a USB Device is Connected to the System - Windows Registry

 

Regards,

 

Luis A.

Applicatios Engineer.

National Instruments.

0 Kudos
Message 3 of 4
(3,270 Views)

Any Luck finding example of event handeled USB unplug ?

0 Kudos
Message 4 of 4
(1,048 Views)