01-31-2023 12:59 PM - edited 01-31-2023 01:00 PM
I want to register for an event that is generated when user unplugs / plugs USB device into PC. I saw solutions in other languages like Delphi and C++ but cannot find a way in Labview...
I don't want to check for devices in a loop, I want to have event generated automatically when this happens.
01-31-2023 01:22 PM
I suspect you will need to use a .NET event that calls a callback VI and have that VI send a user event to your events case.
I would start with this Stackoverflow thread:
https://stackoverflow.com/questions/26975946/detecting-usb-device-insertion-and-removal-in-c-sharp
And try to implement roughly what that person did in, but in LabVIEW using .NET nodes.
This is likely the .NET class to use:
01-31-2023 01:31 PM
Any other hint or maybe even VI that does this?
02-01-2023 07:28 AM - edited 02-01-2023 07:34 AM
You'd have to fiddle a bit with the 'e' object to get useful info, but it's a start...
02-01-2023 08:15 AM
What about continuously checking visa find resource results for changes?
02-01-2023 11:21 PM
Thank you, but could you please save this two VIs in 2019 version? Thanks very much
02-03-2023 03:21 AM
Thanks wiebe@CARYA for the soultion, i was trying something similar but your solution works fine.
Converted to 2019 LV Version and attached.