This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Running a LabVIEW Executable as a Background Process

Updated Dec 6, 2018

Reported In

Software

  • LabVIEW Professional
  • LabVIEW Application Builder Module

Issue Details

I have built a LabVIEW VI into a stand-alone application (executable) using the LabVIEW Application Builder. The executable does not require any user input, so I want to run it as a background task. How can I hide the executable front panel window and remove any taskbar icons that show up when I run the application?

Solution

To hide the application's front panel window and remove any taskbar icons when running an executable, you will need to edit the VI from which the executable was built and then rebuild it. To make the necessary changes, follow these steps:

For LabVIEW 7.1 and later:
  • Hiding the front panel window:
  1. Open the top-level VI that will be built into the executable.
  2. At the beginning of the top-level VI, get the current VI's file path using the Current VI's Path VI located in Functions Palette»Programming»File I/O»File Constants subpalette.
  3. Open a reference to the top-level VI using the Open VI Reference VI, located in Functions Palette»Programming»Application Control.
  4. Connect the path output wire from Current VI's Path to the vi path input of Open VI Reference.
  5. Connect the vi reference output of Open VI Reference to the reference input terminal of a Invoke Node VI, located in the Functions Palette»Programming»Application Control subpalette.
  6. Click Method on the Invoke Node. Select Front Panel in the drop down menu that appears, then select  Open.
  7. Create a constant on the State parameter, then select Hidden.
  8. Close the reference to the VI using the Close Reference VI, located in the Functions»Programming»Application Control subpalette. Your block diagram should now look like this:
  1. After saving your VI, rebuild your executable. 
  • Hiding the Windows Taskbar icon:​
  1. After building the top-level VI into an executable, open its corresponding .ini file. The file should be in the same directory where the executable was built. In LabVIEW 7.1 and previous, LabVIEW does not automatically create an .ini file for you upon building of the executable. Running the VI once will create this .ini file automatically (it will be empty).
  2. Verify that the top line of the .ini file is Application.exe where Application.exe is the name of your executable file.
  3. Add HideRootWindow = True to the .ini file. This will hide the Windows Taskbar Entry for the executable.
  4. Finally, make sure the modified .ini file is placed in the same directory as the executable when the stand-alone application is taken to the target machine.
Note: In LabVIEW 8.0, the HideRootWindow .ini tag discussed above does not work. This was fixed in LabVIEW 8.0.1.
 
For LabVIEW 7.0:
Follow the procedure described above with one exception. You will need to replace the Invoke Node function with a Property Node, located in the Functions»All Functions»Application Control subpalette. After you have wired the VI reference from the Open VI Reference function to the Property Node you will be able to select the Front Panel Window: State property. Finally, create a constant to set it to Hidden
 

Additional Information

As mentioned in the Issue Details section, this method is only recommended for executables that run as background processes and don't require user input. If you need to have any user input through a LabVIEW front panel control or indicator, this method is not recommended because the front panel that contains the controls and indicators will be hidden.

It is important to include a way of closing the program once it is done executing, since you will not be able to access the front panel. One way to do this is to call the Quit LabVIEW function from within your executable, as described in How Can I Exit from My LabVIEW Executable Without Having to Close It?. Otherwise, you will need close the executable from Windows Task Manager or close the application programmatically from another VI as explained in How Do I Programmatically Open and Close a VI Within Another VI?.

The proposed method will hide the front panel of the VI or executable once it is loaded. However, you may notice the front panel being loaded for a split-second before the hiding process is enabled.

WAS THIS ARTICLE HELPFUL?

Not Helpful