LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-use image preview window for different purposes?

I'm writing an application which operates a shutter and acquires images from a FireWire camera.  There is a preview window to help with setting up the experiment and then a window showing the frames being acquired.  The problem is that at the moment the two separate sorts of image window are on separate frames of a stacked sequence structure, which means there are two separate windows on the front panel.  What I need is to have one image window and use it for both purposes, so that the user doesn't have to scroll around while conducting the experiment.

Can the front panel be altered dynamically?  Or is there some other way of re-using an image window?

Part of the VI, showing the first use of the image window is attached.

Adam
0 Kudos
Message 1 of 3
(2,709 Views)
Try a producer/consumer design pattern.  Put the preview window into the consumer loop.  Pass the image from the other two spots in the program using a queue.  I'm not 100% sure this would work because I think the image functions in Labview are based on references to data rather than data itself that can be passed.  But I think it's worth a shot.
0 Kudos
Message 2 of 3
(2,683 Views)

Hi Adam

The easiest way to achieve that is to create a local variable for the image control (right click on the image control and choose Create>Local Variable).

After that, you can use the local variable to update your front panel and you shouldn't have problems with race conditions unless you are trying to read or write to this image control from somewhere else in your program as well.

A better way of doing it would be to use a state machine. Your program will have two (or maybe more) states, 'Configure' and 'Running' .It will start by default in the configure state and you will be able to determine programmatically when the program will transit to the 'Running' state.

This option obviously would require you to rewrite the program so I don't know what would work best for you. I've attached a VI that uses a state machine to achieve what you are trying to do.

Let me know if that helped,

KostasB

NI UK



Message Edited by KostasB on 02-08-2008 05:43 AM
0 Kudos
Message 3 of 3
(2,653 Views)