05-22-2014 09:21 AM
I would like to launch a labview exe with a command line.
I would like to get advice how to launch the Labview exe with giving values to the control parameters?
You can view the example where x,y are the controls
Solved! Go to Solution.
05-22-2014
09:27 AM
- last edited on
05-20-2024
07:27 PM
by
Content Cleaner
There is a much more detailed guide here, which I reference below:
1. First you will enable it in the settings:
1. Open the properties for the application's build specification
2. Navigate to the Advanced category
3. Check the Pass all command line arguments to application box
To pass the command line arguments to the application and access them in your code follow the same steps as for LabVIEW 7.x.
2. Then you will use two hypens (--) to pass command line arguments to the VI.
When you launch LabVIEW or a stand-alone executable from the command line, you can pass user-defined arguments to the application. User-defined arguments start after two hyphens (– –) surrounded by spaces in the command line. For example, the following command line entry will launch LabVIEW 7.1 and open test.vi
from the root of C:\ and pass 2 arguments, 1000 and sine:"C:\Program Files\National Instruments\LabVIEW 7.1\LabVIEW.exe" "C:\test.vi" –– 1000 sine
You can also pass a command line argument directly to an EXE without launching LabVIEW, as long as the machine has the appropriate Run-Time Engine and necessary drivers. For example, if test.vi
was built into an executable, it could be called as follows:
"<build directory>\test.exe" –– 1000 sine
3. Lastly, you will use a property node to wire them to your controls:
LabVIEW passes the arguments from the command line to the block diagram of the VI or EXE you launch. You can reference the arguments in the block diagram by using the Application:Command Line Arguments selection in a property node, as shown below.
05-22-2014
09:30 AM
- last edited on
05-20-2024
07:28 PM
by
Content Cleaner
05-22-2014
09:30 AM
- last edited on
05-20-2024
07:28 PM
by
Content Cleaner
05-22-2014 12:50 PM
There is also a example demo for this at <LabVIEW>\examples\Application Control\VI Server\Passing Command Line Parameters.vi
05-22-2014 02:00 PM
Hi
Thanks for your answer
I am following your instruction for my application (x=10, y=5) "<build directory>\add.exe" –– 10 5
but I get x = y = 0.
What do you think is wrong?
Thanks...
05-22-2014 02:09 PM
You have to do something with the arguments (ie. convert from strings into your numbers).
Show us what code you have. Are you sure you have the executable setup to recieve command line arguments?
05-22-2014 04:17 PM
Hi
The code is in the attachment of the 1st message.
I add a new attachement with a string (gives the length of the argument string)and it does not work as well ( C:\LabView\builds\str\str.exe -- aaaa)
05-22-2014 04:29 PM
05-22-2014 04:29 PM