LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Autoplay Event Handler

Has anybody implemented or experimented with Windows 7 Autoplay event handler in LabVIEW?

 

I found the following link but I don't know how I can make use of the information there.

 

http://msdn.microsoft.com/en-us/library/windows/desktop/hh127462(v=vs.85).aspx

 

 

 

0 Kudos
Message 1 of 5
(2,733 Views)

That's not something that you will be able to do directly in LabVIEW. All those pointers and things - yuck. What are you trying to do when AutoPlay is activated?

 

You could try to use the Windows Message Queue library and register for a device change message.

0 Kudos
Message 2 of 5
(2,718 Views)

My main goal is to create a programming station for SD cards.  I have an SD card reader but would I'd like the programming staiton is to detect the insterion of the SD card and program the SD card.  To make it as fast as possible I would prefer to not have to require the operator to determing wich drive is the SD card.  So basically, they stick the SD card in the drive, the running LabVIEW app detects the new card, copies the files.  A small dialog shows when it is complete and the operator removes the card.  If all the operator has to do is insert the card and remove when finished, it should be able to go through a bunch of cards.

 

My idea was to use Window autoplay events, detect the particular event (SD card), handle the event in LabVIEW.  I can do the programming of the card but I thought I could take it one step further...

0 Kudos
Message 3 of 5
(2,699 Views)

The AutoPlay event is not something I'd use for this. I'd suggest either using the message library and look for the WM_DEVICECHANGE event, or alternatively using .NET WMI interface, though I dont' really think that's going to be any easier or harder.

Message 4 of 5
(2,690 Views)

smercurio_fc,

Thanks for the suggestions.  I've looked into both WM_DEVICECHANGE and the WMI interface.  The thing I notice is that I can trigger events easily with my native Labtop SD card reader for both WM_DEVICECHAGE and the Win32_PhysicalMedia (of the WMI's Event Watcher) but the production will have a multi-device card reader.  I do not get events when I plug in the SD card, I only get events (multiple, one for each port of the reader) when I plug in the reader itself.  Anyway, I do get a single event with Win32_SystemDevices an I may use this approach.  Attached is my code experimenting with the WMI and event watcher...

Thanks,

Paul

Download All
0 Kudos
Message 5 of 5
(2,676 Views)