01-09-2012 06:52 AM
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?
01-10-2012 10:15 AM
01-11-2012 10:59 AM
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,
The other example that can help you out uses window registry key to determine the usb device conection.
Regards,
Luis A.
Applicatios Engineer.
National Instruments.
01-31-2023 10:37 AM
Any Luck finding example of event handeled USB unplug ?