Description
Description-Separate-1Overview
This examples shows how to call a LabVIEW-built executable from the command line, also passing user-defined arguments to the executable.
Description
It is possible to call any executable from the command line using LabVIEW System Exec.vi and pass user-defined arguments. Using Application>>Command Line Arguments Property Node you can read the value of the arguments passed to the executable when called from the command line.
Requirements
- LabVIEW 2012 (or compatible)
Steps to Implement or Execute Code
- Extract attached zip file and open Pass Arguments to Executable LV 2012 NI Verified.lvprj
- Open My Application Build Specification
- In Information category, set Target filename and Destination directory as desired
- In Source Files category, notice that VI to be built into Executable LV 2012 NI Verified.vi has been set as Startup VI
- In Advanced category, notice that "Pass all command line arguments to application" has been checked
- Build the application
- Open Call Executable LV 2012 NI Verified.vi
- Set Executable path control to the path of the executable you have just built
- Set Argument to Pass to any value and press Send button
- The executable will open and display whatever string you typed in the Argument to Pass control in the Command Line Arguments Indicator of the executable.
Additional Information or References
Caller VI Block Diagram
Distributing Applications with the LabVIEW Application Builder
How to Pass Command Line Arguments to a LabVIEW executable
**This document has been updated to meet the current required format for the NI Code Exchange.**
Description-Separate-2