10-27-2008 05:46 PM
Hi
When I am debugging I sometimes open from the block diagram a VI I have made modal. Since it is model, and the code is not running - it locks up LabVIEW and the only way is CTRL+ALT+DELETE to quit labVIEW.
I have heard it is possible to write a VI to fix this problem without closing labVIEW.
I have just had a go writing one that uses the VI refence and VIs in memory to change the window mode to default - but as a VI I can't run it when a modal dialog locks LabVIEW.
So I built it into an app - but it didn't find the VI's open in LabVIEW (which was kinda obvious in hindsight as they would have different memory space).
Have have looked for examples that do this but can't find any.... sugestions?
My attempt (attached) saved for LV8.0
Regards
Nick
I have LV8.6.
10-28-2008 12:08 AM - edited 10-28-2008 12:11 AM
Hi Nick,
This tool is a great idea and it works! Just configure "Close Modal VIs.vi" to Run When Opened (see Execution properties) - and launch it from a File-Explorer window when a modal VI locks-up your app.
While the modal VIs aren't actually closed, they are changed to Default Appearance, so background GUIs become available.
Cheers!
10-28-2008 12:34 AM
10-28-2008 01:03 AM
Thanks guys... I thought I was missing something and the run when opened is it.
It didn't occur to me to serach for abort... (As I didn't want to abort - just change it to default window state).
Cheers
10-28-2008 04:56 AM
10-28-2008 06:41 PM
My VI above will do the job if you change its execution properites to run when opened. It will change all modals to default.
I am working on a better version after seeing the abort VI example linked above. Its now written but needs checked & debugged.
10-29-2008 02:49 PM
Hi -
attached are two VI's.
The first (Change Modal VI front panel to Default.vi) allows you to change the behaviour of selected or all modal dialogs to default when debugging.
If you change the window state to default - you can then press the unmodal button to get back to your app to clean up. Then you can easily reset the selected (former) modal VI's back to modal.
Warning - if this VI is open and you open another Modal Dialog its CTRL-ALT-DEL again as LabVIEW cannot open and run a VI already in memory.
As I was debugging it I realised the problem is not that the window is modal - but that it open when it should not be. So I added a button to close all modal windows.
So the second VI (Close All Modal Dialogs) is a VI that when you run it - closes all modal VI's in memory and then closes itself. This is the simple quick & easy & recommended solution.
As these VI's run when opened - to edit / view the diagram place in a new VI and open from the block diagram.
I have attached a screenshot of the Close Modal VI block diagram.
I have saved these VI's for V8.0
10-29-2008 02:49 PM - edited 10-29-2008 02:58 PM
10-29-2008 02:49 PM - edited 10-29-2008 02:58 PM
10-29-2008 02:49 PM - edited 10-29-2008 02:59 PM