LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

System hangs when a vi2 calls another vi1

I have a vi, deletme2.vi which calls deleteme1.vi. deleteme1.vi has the modal value selected, and set to open when called and close when exited, in vi properties. As long as I run these two as intended things work fine. If I inadvertently have the deleteme1.vi open when I run deleteme2.vi my system will hang and the only operation that I can do is press the stop button on deleteme1.vi(though it has no action). Alt-Tab will not let me get to deletme2.vi and CTRL-. does nothing either.

I am running LV6.1, on Window 2000 Pro,

Any ideas or suggestions
Download All
0 Kudos
Message 1 of 4
(2,726 Views)
Hi gold,

I will try to explain what is happening.

I have looked at your VI's.

Under Normal conditions When You run any toplevel VI (Say delete2.vi). Automatically all Vi's needed by this Vi get reserved. LV then prepares all Vi's with their default characteristics. In our case delete1.vi is modal. It will be called when the even Structure enters the timeout Event (the way you have configured this, it will never happen.). This VI will be reserved for running. Now when the Subvi is called it will Show its front panel and this panel will be modal.

But if the Panel is already open... As soon as you run the Top VI, the subvi is prepared as modal Window. And waits for it to be run. But the Front Panel is open and In our case this Vi is modal so it will be on
top. So you cannot go to bottom Vi and do anything. This is expected. The CTRL+. keys will stop a Vi if it is running. But Our Modal VI is not running, it is reserved for running.

What you can do is in VI Properties-> Window Appearence you can Check the "Allow User to Close Window" Option. And also to debug have the Menu and tool bars Visible so you can see what happens.
If you do this and run your VI the SubVi will be on top as it is modal. But you can close this Vi using the Close Button and revert to your Main VI.

This is Just an idiosyncracy of Labview. Nothing to do LV6.1 or Win 2000. The same Behaviour can be simulated with case structure in a while loop.

By the Way, You should put some delays in your While Loops and also What is the Point of having this VI in timeout Event with the Timeout terminal left unwired?

Regards,

Mache
Good Luck!

Mache
Message 2 of 4
(2,726 Views)
Thanks Mache

Makes perfect sense once its explained! Thanks for the advice on how to overcome it.

Still seems as though National should create a way out of this, having a system lock-up is not a great behavior no matter what the cause.

I created these vi's just to try and duplicate my problem so they were very basic thats why I didn't wire the timeout terminal or have any delays.

Thanks again,
Gold
0 Kudos
Message 3 of 4
(2,726 Views)
> Makes perfect sense once its explained! Thanks for the advice on how
> to overcome it.
>
> Still seems as though National should create a way out of this, having
> a system lock-up is not a great behavior no matter what the cause.
>
> I created these vi's just to try and duplicate my problem so they were
> very basic thats why I didn't wire the timeout terminal or have any
> delays.
>



The best way out of this is to build a simple VI that opens modal and
run when opened. Then have it use the VI server to either abort all top
level VIs or makes a list and let you select and abort a specific one.
Place this VI on the desktop and whenever you find yourself in this
situation you double click this VI. Since it is modal, it will open o
n
top of all other modal VIs and let you get out of the situation.

Greg McKaskle
0 Kudos
Message 4 of 4
(2,726 Views)