LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

vi running in the background

Hi,

I try to write a VI running in the background -- but it doesn't work properly.

The VI is supposed to do the following:

  • hide the panel

  • write 1st time (actual time) to c:\temp\wtft.txt

  • wait 5 sec

  • write 2nd time (actual time) to c:\temp\wtft.txt

  • show the panel

  • wait 1 sec (just to see the panel)

  • exit



The hiding and exiting are easily adjustable using booleans for testing purposes. The front panel is completely empty.

Everything works as expected in the development system. But it doesn't after building an application. When running as application, the 2nd time won't be written to the text file if the panel is hidden. As far as I underst
and that's because the VI is terminated after the panel is closed. But I have a reference to the VI opened and I just close it after showing the panel again.

Can someone give me a hint what I'm doing wrong?

The VI in question is attached. We're running LabView 6.1 in Windows 2000.

Thanks,
Carsten
0 Kudos
Message 1 of 3
(2,776 Views)
A built application must always have one window visible, otherwise the application terminates, having a reference open does not help.

Opening a reference to avoid a VI from terminating is useful e.g. if you dynamically load a VI using an invoke node and the wait until finished set to false (if you close the reference the VI will terminate...the trick is to make it open a reference to itself prior to closing the reference in the caller). But again - the application must always have one window visible. That window can be minimized and/or moved off-screen, but not closed.
Message 2 of 3
(2,776 Views)
You can use WinApi functions to hide/show/max./min./resize/etc. window.
To remove application from task bar write in "yourapplication.ini" file in section "[yourapplication]" key HideRootWindow=TRUE.
Romek.
Message 3 of 3
(2,776 Views)