LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open subVI and don't close

Hi ceties,

You need to add a "Panel Close" event in your subVI if you want to support users closing it with the 'X' close button in the window titlebar corner and having that action behave just like clicking the "Close" button in your panel.  Read the LabVIEW Help for more information about the Panel Close event, or just using the Event Structure in general.

Good luck,

-D

Message 11 of 33
(1,443 Views)
Hi Darren,
thank you for your fast reply. It works, but problem is that the "Open" button (in open.vi) is still pushed. It means that I can't call Graph.vi again (not second instance just call again when it is for example minimalized) until I close it.

Do you have any idea?
I'm much obliget to you.
LV 2011, Win7
0 Kudos
Message 12 of 33
(1,435 Views)

Hi ceties,

Move your "Boolean" control into the event structure case that is checking for the value change event on that control.  Right now you have the terminal in the while loop diagram instead of the event diagram...this will cause unexpected behavior with latch booleans.

As a rule, if you have a Value Change event configured for a control, you should always put that control's terminal within the Value Change event case diagram.

Good luck,

-D

Message 13 of 33
(1,430 Views)
Nice! Thanks!
But I can't still do anything at open.vi until I close graph.vi
Final solution? 🙂
LV 2011, Win7
0 Kudos
Message 14 of 33
(1,429 Views)

Hi ceties,

In order to be able to interact with your main VI while still viewing the subVI, you must call the subVI dynamically.  To do this, you need to use VI Server to call the Run VI method, but before you do this, you have to set the 'subarray' value to contain your data, then programmatically show the front panel of the VI.  This may seem complicated if you're not familiar with VI Server, but take a look at your modified VI I have attached below, and hopefully it will make more sense to you.  I included some comments in the diagram of open.vi with some tips that you will hopefully find helpful.

Good luck,

-D

Download All
Message 15 of 33
(1,424 Views)
Hi Darren,
thank you very much, you help me again but as you wrote it seems for me little complicated. I must think about it. For the present I will use the previous method and just make the graph.vi modal to force the user to close the panel.

Bye
LV 2011, Win7
0 Kudos
Message 16 of 33
(1,410 Views)

Hiii, Darren & Dennis,

              I am confused now about running the vis parallely, actually, as i shown you the vis about, counter in the before posts, but if we saw it fundamentally, then we want that, i want to run the vis, parallely, mean whenever one vi is runnung from the bunch, then other vis should not stop, but in my case it is happening like that, and the same thing is also happenning in the other vis, whenever one of vi called bcoz of trigger, then the control is going to that vi, and other vis stop running, only the called vi is runnung and the vi from which it is called is stoping, so in that case wat u suggest me to do? should i call the vi directly or should i called it by reference or i should call it by the ActiveX, can you please explain me it with the example... please? i am in so much doubt in this things, i am somewat new to labview.

Thanks,

Nishant

0 Kudos
Message 17 of 33
(1,405 Views)

Nishant,

Take a look at the example I posted on this thread of calling a VI dynamically.  If you want to launch a VI from another VI, and still be able to interact with both VIs, then your only option is calling the VI dynamically with the "Run VI" method, and setting "Wait Until Done" to False.  Any other method (subVI call, Call By Reference, Run VI with "Wait Until Done" set to True) will cause your main VI to sit and wait until the called VI is done.

I suggest you also take a look at the VI Server examples that ship with LabVIEW.

Good luck,
-D

0 Kudos
Message 18 of 33
(1,392 Views)

Hiii, D

       Thanks man, that method works for me for the executing the vi, by calling it and to synchronously put the control on both of the vis, but when i am giving an event to one stop(its type is stop)button, it is affecting another stop button, when i am trying to stop the while loop stop button, it stops the vi. so what could be the problem in that? is it possible that all the button which has same type are control by single event?

Thanks,

Nishant

0 Kudos
Message 19 of 33
(1,377 Views)

Hi Nishant,

I don't really understand your question.  Could you perhaps repost with more details?  A sample VI demonstrating the problem you're having would be a huge help.

-D

0 Kudos
Message 20 of 33
(1,370 Views)