LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I force a VI to execute on any LabVIEW process termination?

I need a technique for executing a VI upon any LabVIEW termination. In particular, the solution must include executing the VI when no other VI is running and the user selects File->Exit (File->Quit on Sun).
0 Kudos
Message 1 of 8
(2,964 Views)
I assume you don't have the application builder. But if you did then you could create an executable in LabVIEW that would run idle and monitor if the LabVIEW application has been closed, then launch the VI you desire.

But of course, if you had application builder you would just make an application and just prevent the user from quiting in the first place...


Michael Aivaliotis
VI Shots LLC
0 Kudos
Message 2 of 8
(2,964 Views)
I have a dll which I have ported from Windows to Sun. Under Sun, the correct technique is to cleanup the dll on termination with function - "atexit()". Using this function solved my problem. Thanks for your answer. W. Brown.
0 Kudos
Message 7 of 8
(2,964 Views)
Just out of curiosity, why do you need to do this? There may be another way around your problem.
0 Kudos
Message 3 of 8
(2,964 Views)
I have a dll which, under Windows, uses correct dll protocol to cleanup on termination. I have ported my app to LabVIEW Sun and, until 2 days ago, was unable to find the correct technique to terminate the shared object under Unix. The function under SOLARIS is "atexit()" which I now use successfully to solve this problem.

Thanks for your response. W. Brown
0 Kudos
Message 6 of 8
(2,964 Views)
Hi,

If you really need this, you can create a dll in some other language. When
the dll is removed from memory (DLL_PROCESS_DETACH), call the windows api
ShellExecute, with as file name the vi you want to open.

Put the dll somewhere in your main. If you close main, the dll will be
removed, and the shellexecute will open the vi...

It just might work, but the other sugestions (custom menu) are a much better
way to do it.

Regards,

Wiebe.


"wwwbrown" wrote in message
news:50650000000800000082300000-1004225886000@exchange.ni.com...
> I need a technique for executing a VI upon any LabVIEW termination.
> In particular, the solution must include executing the VI when no
> other VI is running and the user selects File->Exit (File->Quit on
> Sun).
0 Kudos
Message 4 of 8
(2,964 Views)
Hi,

I've tested this, it works!

Wiebe.


"AIR" wrote in message news:9so3je$19i$1@news1.xs4all.nl...
> Hi,
>
> If you really need this, you can create a dll in some other language. When
> the dll is removed from memory (DLL_PROCESS_DETACH), call the windows api
> ShellExecute, with as file name the vi you want to open.
>
> Put the dll somewhere in your main. If you close main, the dll will be
> removed, and the shellexecute will open the vi...
>
> It just might work, but the other sugestions (custom menu) are a much
better
> way to do it.
>
> Regards,
>
> Wiebe.
>
>
> "wwwbrown" wrote in message
> news:50650000000800000082300000-1004225886000@exchange.ni.com...
> > I need a technique for executing a VI upon any LabVIEW termination.
> >
In particular, the solution must include executing the VI when no
> > other VI is running and the user selects File->Exit (File->Quit on
> > Sun).
>
>
0 Kudos
Message 5 of 8
(2,964 Views)
My Windows LabVIEW application uses a dll for which I use DLL_PROCESS_DETACH to cleanup. I ported my app to Sun LabVIEW and needed the same functionality. I found it finally using SOLARIS function "atexit()" which allows you to specify a cleanup function for execution when a shared object (dll) is terminated.

Thanks for your answer - W. Brown
0 Kudos
Message 8 of 8
(2,964 Views)