LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need to open/close VIs from command line

I need a method for either closing a currently running VI from a command line and then opening a VI of the same name immediately after, or a way of suppressing the View/Discard dialogue box when reloading a VI from disk.

Is there a list of available command line switches for Labview?
0 Kudos
Message 1 of 2
(2,976 Views)
Hi Xocet,

There is a table of LabVIEW-defined command-line arguments available in the LabVIEW Help file (open LabVIEW->Help->VI, Function, & How-To Help...). Search for 'command line' and bring up the page titled "Launching a VI from the Command Line."


However, there does not seem to be an option available to suppress the View/Discard dialog box when reloading a VI from disk.


A possible workaround would be to write another VI that uses a VI Server call to close the VI that is in memory. You could pass in the actual VI to run via a user-defined argument that is passed when LabVIEW is launched from the command line (refer to the help page titled "Application:Command Line Arguments Property" in the LabVIEW Help).

The other issue in this case is that user-defined arguments are only read when LabVIEW is initially launched (LabVIEW cannot already be open). Therefore, the program must be built into an executable. To pass in command line arguments to an application, place a checkmark in the Pass all command line arguments to application checkbox in the Application Settings tab of the Build Application or Shared Library (DLL) dialog box.

I have attached a zip file that contains the following:
1. Executable program to run via command line. to this post.
2. Calling VI.VI that contains the actual VI to run that will close the front panel of the VI that is passed in via command line. Since this VI is set to run in "silent mode" (the VI closes automatically after running), it will not open through a File->Open in LabVIEW. Instead, open a blank VI and drop it in as a subVI (All Functions->Select a VI...). Then double-click on the subVI and the front panel will display.

To run the executable, go to the directory where the Application is saved and type in the command window:
  • Application.exe


  • No errors will be thrown if the VI is not in LV memory.

    Hope this helps!

    Kileen C.
    Applications Engineer
    National Instruments
    Download All
    0 Kudos
    Message 2 of 2
    (2,976 Views)