LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plug&Play

Hello!
Could someone told me how to handle the windows messaging in LabVIEW 7.1.
I want to notify when my USB device plugged in or off the computer. In C I'm
listen on the messagequeue and when I get the message WM_DEVICECHANGE with
the wParam DBT_DEVICEARRIVAL or DBT_DEVICEREMOVECOMPLETE I send a message to
my application (better the window of my application). Is there a possibility
in LabVIEW to do this like in C or how could I manage the message handling
between windows and my LabVIEW application.

Thank you Birgit
0 Kudos
Message 1 of 10
(4,648 Views)
Birgit,

It is possible to do Windows message handling in LabVIEW 7.1. Please see the link below for a set of VIs that will accomplish this.

Windows Message Queue Library

I have also attached a small example that will show detection of plug and play devices. You will need to install the code above before this example will work.

Good luck with the development,

Regards,

Matt F
Message 2 of 10
(4,647 Views)
Many thanks to all of you!          It is what I am looking for... 

Flying...
www.vihome.com.cn 虚拟仪器家园
0 Kudos
Message 3 of 10
(4,521 Views)

Hi all,

Thank you for providing this.But the vis and dll provinding the same values for connecting the device and for removing the device.

is there any possibilty to find wether the device is attached or detached seperatly.

 

thank you in advance for your help,

Bannu.

0 Kudos
Message 4 of 10
(4,441 Views)
Hi Bannu.  Thanks for contacting National Instruments!

The ReadMe file in the above-referenced library lists out the Windows Messages available.  The WM_DEVICECHANGE detects whether the device is attached or detached.  In the example VI above, a case structure is used to account for the different parameters (plugged in or unplugged), so you could implement something similar for the individual cases, if you are just looking to do one or the other.

For more information on any message, please check the Win32 SDK documentation, which is available at microsoft.com.
Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 5 of 10
(4,412 Views)
Hi,
 
Thanks for your reply.
ya i checked the Parameters "hWnd,Msg,wParam,lparam" when the 1394 camera attached and camera detached.
m getting the same values at both situations.can you tell y m getting the same values.
 
is there any possibility to differentiate attached n dettached.
 
and tel me what  "WM_DEVMODECHANGE" message will do......
 
please help me..
 
Thanks,
Bannu.
0 Kudos
Message 6 of 10
(4,391 Views)
Hi Bannu!  Are you using the IMAQ driver to communicate with your 1394 camera?

If so, the following KnowledgeBases may be of some help to you:

KnowledgeBase 3WAC7UD3: Finding Attached IEEE-1394 Cameras Programmatically

I'm not an IMAQ expert, so you may have more luck searching and posting on their forum.

Hope that helps!

Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 10
(4,371 Views)
Sorry - that first link should be:

3WAC7UD3: Handling Attached and Detached 1394 Cameras

And the second one is KB 3SJC01QT:  Finding Attached IEEE-1394 Cameras Programmatically
Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 10
(4,370 Views)
Hi all,
 
In the same manner can we send the windows messages to some other application? is it possible?
 
thanks in advance,
Bannu.
0 Kudos
Message 9 of 10
(4,301 Views)
Bannu,

I believe you may find what you need in the Windows API Function Utilities example program.  This same sort of question has also been addressed in other forums (see 1 and 2, for example).  Otherwise, this may also be done through ActiveX, which is the subject of many other discussion forums.

If this is not what you were looking for, it may help to clarify what your "other application" is exactly. 
Lorielle P.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 10
(4,268 Views)