LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Quit LV" creates exception - How can i exit created application with button-click?

Highlighted

Hello,

i added a small vi-popup at beginning of my program where user can select between 3 buttons. The fourth button is Exit that should exit the application.

For this i added the "Quit Labview" = True.

It works fine in developer-mode but when i run it in the application exe-file this creates the following exception:

 

CRASH.png

 

Why is this not working in a application?

Is there a better thing to quit the program?

 

Thx

0 Kudos
Message 1 of 7
(1,403 Views)
Highlighted

OnlyOne wrote:Is there a better thing to quit the program?

Let your program stop normally.  This means getting your code to where there is nothing else to run.  It could be as simple as just stopping the loop in that dialog and letting the VI finish.  You should then also close the front panel.  Avoid the Quit LabVIEW and the Stop functions like the plague.  They are the same as hitting the abort button in the toolbar.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 7
(1,394 Views)
Highlighted

The problem is that this is sub-vi Nr 2 of 10 that are all connected in a row with the error in/out.

That means i would have to put the other 8 sub-vis inside a case-structure and give the "close"-vi an output to feed the case.

It is simpler to just kill the whole LV.

 


 

####
#Date: Di, 9. Sep 2014 19:08:43
#OSName: Windows 7 Ultimate Service Pack 1
#OSVers: 6.1
#OSBuild: 7601
#AppName: XXXXX
#Version: 13.0.1 32-bit
#AppKind: AppLib
#AppModDate: 09/09/2014 16:53 GMT
#LabVIEW Base Address: 0x30000000


starting LabVIEW Execution System 2 Thread 0 , capacity: 24 at [3493127323,39019060, (19:08:43,390190602 2014:09:09)]
starting LabVIEW Execution System 2 Thread 1 , capacity: 24 at [3493127323,39019060, (19:08:43,390190602 2014:09:09)]
starting LabVIEW Execution System 2 Thread 2 , capacity: 24 at [3493127323,39019060, (19:08:43,390190602 2014:09:09)]
starting LabVIEW Execution System 2 Thread 3 , capacity: 24 at [3493127323,39019060, (19:08:43,390190602 2014:09:09)]

<DEBUG_OUTPUT>
09.09.2014 19:08:44.496
Crash 0x00000000: Crash caught by NIER
File Unknown(0) : Crash 0x00000000: Crash caught by NIER
minidump id: 02df131c-8b0b-4227-860a-d1f27df161c8
ExceptionCode: 0xC0000005

</DEBUG_OUTPUT>
0x30761D96 - lvrt <unknown> + 0
0x3076211C - lvrt <unknown> + 0
0x7C37FDB4 - MSVCR71 <unknown> + 0
0x75A40303 - kernel32 <unknown> + 0
0x77E174FF - ntdll <unknown> + 0
0x77DD9F45 - ntdll <unknown> + 0
0x00000000 - <unknown> <unknown> + 0

0 Kudos
Message 3 of 7
(1,365 Views)
Highlighted

Quit LabVIEW is really more equivalent to Kill LabVIEW. It is indeed the same as pressing the abort button and as an analogy about the same like stopping your car by crashing it in a wall. Effective but not very nice!

 

It doesn't allow your application to close resources properly and some third party external drivers take that rather personally by crashing the process that created resources in them.

Rolf Kalbermatter
Averna BV
0 Kudos
Message 4 of 7
(1,359 Views)
Highlighted

@OnlyOne wrote:

 

It is simpler to just kill the whole LV.


It is simpler to use a GOTO than to re-write the application design but we all know how that goes.

 

Have a proper clean-up. Give the application a chance to release resources, and close references.

0 Kudos
Message 5 of 7
(1,349 Views)
Highlighted

If it is causing too many problems to terminate a program properly, that is a problem that you need to fix. Using the Quit LabVIEW function is masking a larger issue.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(1,332 Views)
Highlighted

@OnlyOne wrote:

The problem is that this is sub-vi Nr 2 of 10 that are all connected in a row with the error in/out.


Two simple solutions here.

  1. Change to using a state machine
  2. Make all of your subVIs skip their code is there is an error passed in.  This would be done with a case structure.

I recommend going with #1.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 7 of 7
(1,327 Views)