LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Duel Windows

I have a Vi (main). I would like to open 2 JPEGs in a second window (sub). I can do this part that is easy.
 
My problem is I want to interact with the main while the sub is open, and that is my problem, I can't do this.
 
When the sub is called from the main, the main is paused and I can no longer interact with it.
 
The only way I can interact with the main is if I close the sub, but I do not what to do that.
 
******
I want to be able to have the sub open as a refrance, while interacting with the main.
******
 
Currently the sub is a subVi, that was the only whay I know to open the images in a new Window.
If there is another way to open the images in a new window then maby that works better?
 
Any help or ideas would be greatly appreciated.
 
Thanks,
Seraj
0 Kudos
Message 1 of 9
(3,104 Views)

You need to launch these windows in their own thread.  I would suggest using floating windows property and passing a queue or a reference to the main vi if you need inter-window communications. But this can be done with labview with no problem.  Look as upening the subwindow vi and calling the method run with wait for complete =False.  magic this window is nor running in its own thread.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 9
(3,072 Views)
Or you can simply set the sub-vi to open when called but not close afterwards.

This can be done by setting the "Window appearance" of the sub-VI.

This allows you to send the sub-VI data, it will return as soon as it's finished but will not close.  Running the sub-VI again with new data will update the window.  You can close the sub-VI by having a boolean input telling it to close or not.

Please let us know if you're familiar with HOW to do this....

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 9
(3,052 Views)
Thanks for the help. I have tried what both of you have told me. I did not know how to do it so i reserached it in the help menus and such.
 
Unfortunetly It still will not work.
 
Maby I am doing what you have suggested incorectly.
 
attached is the file take a look at it.  
show_all_pos2.vi is the respective main, and Child seat Image.vi is the subVi.
 
It probibly will not run for you because they call other things that I have not given you but you can see if I am structuring it corrctly.
Seraj.
Download All
0 Kudos
Message 4 of 9
(3,036 Views)
I should let you know. There is already code in there to open the images in the same window, That is what I am trying to replace with the subvi so they open in a new window. I did not deleat them so just disregad that part.
0 Kudos
Message 5 of 9
(3,037 Views)
The reason you can't interact with the main window is because you customized the window appearance of Child seat image.vi to be modal. When a window is modal, you cannot iteract with other windows.

Also, I noticed that Child seat image.vi has a 'free running' while loop. There is no delay in the loop waiting for you to press the 'close' button, so it will run as fast as possible. You can probably put a 'wait' for 100ms in that loop. or change it to use an event structure.

Hope this helps.
intvsteve
LabVIEW R&D
0 Kudos
Message 6 of 9
(3,015 Views)

Yes make your free running windows floating (acts more like child windows of the application) and use a event structure to handle the speed of the loops.  There are many ways to get this to work depending on the degree of interaction you need between the child windows.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 9
(3,011 Views)

Thanks for the advice I will try it first thing when I get back to work.

Again thank you for you help.

Seraj

0 Kudos
Message 8 of 9
(2,997 Views)
Thank you all for you help,
 
 I got it to work.
 
0 Kudos
Message 9 of 9
(2,945 Views)