05-11-2023 04:00 PM
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.
05-11-2023 04:31 PM
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.
05-11-2023 09:50 PM - edited 05-11-2023 10:38 PM
@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)
05-12-2023 02:39 AM
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:
You probably want to add the VI in a disabled case, because find all instances won't find the dynamic call.
05-12-2023 03:08 AM
@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.
05-12-2023 04:08 AM
@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.
05-12-2023 04:15 AM
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.
05-12-2023 04:30 AM
@pincpanter wrote:
Alternatively, you need another way to terminate clones.
Sadly, there are 'OK-ish' ways, but no good way to do that. 😑
05-12-2023 04:50 AM
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.
05-12-2023 09:43 AM
@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)