LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

The root cause for the case that "cannot close labview-generated exe file"

Hi Adam, thank you for your advise. I followed your suggestion and found this code 

http://digital.ni.com/public.nsf/websearch/4BE0544020D101AA8625687400638594?opendocument&Submitted&&...

 

It is working in my program if I place an "exit" button in front panel. But what exactly I want is to achieve "Click X on the top right side" to close front panel. Do you know how can I do that? Currently if I click this "X", the front panel stays there but all the buttons cannot work.

 

 

 

0 Kudos
Message 11 of 14
(337 Views)

hi

 

attached is a simple code explaining how you can close the module.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 12 of 14
(328 Views)

Thank you! I have solved it!

0 Kudos
Message 13 of 14
(307 Views)

@adambe wrote:

Assuming you already have an event structure for GUI inputs....

 

1. Create a new event:   <This VI>  -> Panel Close?

2. Wire a true to Discard?

3. *Execute the code that is being run on a GUI Stop button command.*

4. Use (This VI) invoke node Front Panel.Close   to close the vi after execution completes.

 

If you don't mind your VI running in the background until it finishes closing up shop, you can skip steps 2 and 4.

 

Without seeing your code, it will be difficult to give you more help other than these generalizations.


NO. You can't skip step 2.  The Red X is like hitting the abort button on your VI.  It kills the process and keeps the code you want to run in step 3 from ever running.

 

See http://forums.ni.com/t5/LabVIEW/executable-process-persist-after-X-closing-window/td-p/1803056 for more information on the Red X Panel Close? event.

0 Kudos
Message 14 of 14
(304 Views)