View Full Version : LabVIEW, global variable

April 26, 2010, 21:42:01

I am using LabVIEW 8.2 with IC Image Control 3.0.

Currently I am facing the following problem:
I have one central vi for configurations of the video stream of a USB camera.
So the imagecontrol and its configuration are in there, as well as a display ( from imagecontrol) of the current camera output on the front panel.

I would like to have the the display on the front panel of another vi though, because I want to view the live camera-output on another screen (which is still connected to the same PC).

I tried to define a global variable containing an imagingcontrol.ctl but the global variable could not receive the camera output, so the displaying vi could neither...

Is there a possibility to transfer the camera data to another vi?
Could I use pointers? If yes, how would I do that in labview?

I would be glad about any hints or help ;)


Stefan Geissler
April 27, 2010, 12:22:59

the only way I see is to copy the image data into a picture control and display this control on your other panel. This could be done using the ImageAvailable event, but I am not sure, how to implement this in LabVIEW.

April 28, 2010, 13:48:48
Thank you for your quick reply,

I already successfully copied the video stream by using the "grab" tool into a global variable, so I could use it on another vi. The problem with that solution is that it introduces a frequency with which pictures are made, for example I can only display 2 pictures per second on the screen.

The problem is that another machine also needs these pictures but with other frequencies! Also the live camera data would be much better for overviewing the experiment.

Might it be possible to duplicate the camera stream in any way, so the camera could be accessed by two independent vi's?

Why does it not work to transfer the live camera data with a global variable?


PS: Might there be a solution not involving labview? i would try that too (yes i am desperate ;)

Stefan Geissler
April 28, 2010, 15:07:05
Hello Jan,

I am suprised, that the display is so slow. If you try the precompiled Sample Overlay Bitmap application, then you can see, that displaying the same content twice in different windows is fast enough.

As I wrote in my first answer, you should use the IC Imaging Control ImageAvailable event. This event is called automatically, if a new frame was delivered. (Set the property "LiveCaptureContinuous" to true.)

Then you can modify the IC_Grab VIs, so they do not call the "MemorySnapImage" method and receive the ImageBuffer passed to the ImageAvailable event. As result you receive an IMAQ or LabVIEW Picture, that can be passed to your second panel (this is LabVIEW stuff, thus I run out of knowledge). I think, this should work fast enough.

I added a VI that uses the ImageAvailable event to this post. Maybe it is helpful for you.