LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about closing a dialog that is open by mistake, freezing program

Hello,

 

I have a few VI's in my application that I have configured as Dialog boxes. If I have them open by mistake when my main VI is running during debug, they take over and prevent me from doing anything. Alternatively, if I attempt to debug them and probes are installed on them, when the dialog completes and begins to "close" it stays open and does the same thing. The only thing I find that works to regain control is ctrl+alt+delete the program to death and restart it. Ctrl+. doesn't work nor can I change VI windows. It's not a critical issue as the VI's work as intended, its just annoying and would like to know if there is a trick to fix it.

Is there a way to force those VI's to close? Or prevent this behavior? I presume not.

Untitled.png

0 Kudos
Message 1 of 22
(1,571 Views)

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 

George Zou
Message 2 of 22
(1,559 Views)

@zou wrote:

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 


Champions Tip 

Avoid the three finger salute 

 

Adding LINK 

 

OK

I once wrote a detailed document about why "Typical Dialog vis" should have been abandoned.  I know I  presented it as a "Champions Tip" at a former client in 2011- 2012.  

 

I even captured it on THESE FORUMS under a  "FAQ Document "

 

All kudos for a link.   TEMPO knowledgeable developers use the "Dialog Templates.vit" now.  A "Dialog.vim" is almost a decade overdue!

 

The original document is still on my H drive "bohrejj1"@Me####nic

 

Yes, AQ and I have gone a few rounds over "TBD Core.vi "  (without any real improvement in 20+ years)


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 22
(1,517 Views)

A way to avoid the change to run mode is by calling the VI dynamically:

 

Right click all calls to the VI

Select Call Setup...

Change to "Reload on each call" or "Load an retain on first call".

 

The VI will look like this:

wiebeCARYA_0-1683877126026.png

You probably want to add the VI in a disabled case, because find all instances won't find the dynamic call.

0 Kudos
Message 4 of 22
(1,491 Views)

@zou  ha scritto:

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 


This is a very useful information I did not know despite programming in LabVIEW since 2005.

So far I used the attached vi that at least allows to stop the program without killing LabVIEW. It does not always work, though.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 22
(1,474 Views)

@pincpanter wrote:

@zou  ha scritto:

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 


This is a very useful information I did not know despite programming in LabVIEW since 2005.

So far I used the attached vi that at least allows to stop the program without killing LabVIEW. It does not always work, though.


You'd need to kill all running clones too.

 

But there isn't a way to get all running clones. (AFAIK, VI Server operations to clones are still not officially supported).

 

You'd have to generate clone numbers (through a hash like algorithm), and hope iterating over the first 10, 100, 1000, is enough to stop them all.

0 Kudos
Message 6 of 22
(1,455 Views)

wiebe@CARYA  ha scritto:

@pincpanter wrote:

@zou  ha scritto:

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 


This is a very useful information I did not know despite programming in LabVIEW since 2005.

So far I used the attached vi that at least allows to stop the program without killing LabVIEW. It does not always work, though.


You'd need to kill all running clones too.

 

But there isn't a way to get all running clones. (AFAIK, VI Server operations to clones are still not officially supported).

 

You'd have to generate clone numbers (through a hash like algorithm), and hope iterating over the first 10, 100, 1000, is enough to stop them all.


Yes, it only works in a relatively simple architecture. Alternatively, you need another way to terminate clones. Still, it worked for me in many cases.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 7 of 22
(1,449 Views)

@pincpanter wrote:
Alternatively, you need another way to terminate clones. 

Sadly, there are 'OK-ish' ways, but no good way to do that. 😑

0 Kudos
Message 8 of 22
(1,439 Views)

Here's a quick VI that (if running) asks to close a window when activated.

 

It will close any VI (running or not), probably including clones.

 

It won't stop VIs, but, if it's the last instance might remove the VI from memory. LV will ask to save the VI.

 

If you get a modal VI block, open the VI from Windows explorer, it will run (Run When Opened should be true). When re-activating the blocking VI you should be ask to close it.

Close Modal Window.png

0 Kudos
Message 9 of 22
(1,421 Views)

@JÞB wrote:

@zou wrote:

Don't set VI to modal in the VI properties window.

Do this using property node instead.  So if your VI is not running, it's not modal.

 


Champions Tip 

Avoid the three finger salute 

 

Adding LINK 

 

OK

I once wrote a detailed document about why "Typical Dialog vis" should have been abandoned.  I know I  presented it as a "Champions Tip" at a former client in 2011- 2012.  

 

I even captured it on THESE FORUMS under a  "FAQ Document "

 

All kudos for a link.   TEMPO knowledgeable developers use the "Dialog Templates.vit" now.  A "Dialog.vim" is almost a decade overdue!

 

The original document is still on my H drive "bohrejj1"@Me####nic

 

Yes, AQ and I have gone a few rounds over "TBD Core.vi "  (without any real improvement in 20+ years)


Found that link


"Should be" isn't "Is" -Jay
Message 10 of 22
(1,380 Views)