From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Autorun VI from command line

Hi,

 

I've got a VI which I'm still, er, "debugging" 🙂

 

I want to set it up so it runs automatically, but also have the option of editing it if necessary. Therefore, I don't want to set the "Run when opened" VI property.

 

Is there a command line option to start Labview and run a VI automatically? E.g. something like:

 

"<path to LV exe>\labview.exe" "<path to VI>\test.vi" /run

 

I could then make this into a shortcut and put it in the Windows startup folder.

 

However, it would mean I also have the option of starting Labview normally and opening test.vi without it going off and doing all sorts of stuff before I get a chance to stop it.

 

Or have I missed something somewhere?

 

Thanks,

Dave

 

0 Kudos
Message 1 of 4
(5,086 Views)

The list of supported command line options for LabVIEW does not have such a switch. You can, instead, do this using the VI Server by creating a separate VI that's set to "run when opened" that will open a reference to your VI and run it.

 

 

You can pass user-defined command line options to LabVIEW which you can then read into this "runner" VI. There's an example that ships with LabVIEW showing you how to parse user-defined command line options. Open the Example Finder and search for "command".

Message 2 of 4
(5,074 Views)

If you drop a Run when open VI in another VI and open it from the block diagram...

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 3 of 4
(5,065 Views)