LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to show a warning message when someone tries to stop .vi?

Solved!
Go to solution

I have an instrument that generates .dat files at a rate of several a second.  The instrument saves the files on a PC.  The PC has a LabVIEW .vi that checks for new .dat files.  If a file is found, the .vi reads the data, calculates a value, then deletes the file.  If the LV application is stopped by someone before the instrument is turned off, the hard drive will fill up within hours.

 

The .vi is set up to run when opened, but I need a warning message to pop-up in case someone tries to stop the vi.

 

Any suggestions?

0 Kudos
Message 1 of 7
(3,900 Views)

Use an Event Structure and use the Panel Close? Event. You can use this event in conjunction with any stop buttons you have. Have a look at the attached image. If you have any questions, post back.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 2 of 7
(3,893 Views)

Will that work if someone uses Task manager to close the program?  Just curious.

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 7
(3,888 Views)

It should work if you use the Application Close? event.

Message Edited by Adnan Z on 03-23-2009 10:03 PM
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 7
(3,883 Views)

When you say this can be used with "any" stop buttons, does this also include the one on the toolbar?

 

 

Use an Event Structure and use the Panel Close? Event. You can use this event in conjunction with any stop buttons you have. Have a look at the attached image. If you have any questions, post back.

0 Kudos
Message 5 of 7
(3,839 Views)
Solution
Accepted by epster88

Hi epster,

 

no, the abort button will not be catched by this one. But you should hide the toolbar anyway when the vi is running...

Message Edited by GerdW on 03-23-2009 07:05 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,837 Views)

Gerd & Adnan,

 

Hiding the abort button was exactly what I needed.  I will incorporate Panel Close? to cover the other .vi exit point.

 

Have a good day.

0 Kudos
Message 7 of 7
(3,822 Views)