» Calling External Code » Calling Scriping Languages and Executables
LabVIEW allows developers to run executables from VIs using the System Exec VI (Functions Palette » Connectivity » Libraries & Executables » System Exec).
This VI allows the developer to pass command line arguments to the executable. In addition, the System Exec VI redirects the Standard Input, Standard Output and Standard Error pipes of the executable to LabVIEW so that you can access these from your VI.
The following example installs with LabVIEW:
Calling System Exec VI: labview\examples\comm\Calling System Exec.vi
Scripting Languages are programming languages that are typically interpreted during run-time rather than compiled into an executable before running. This means that in order to run a script written in a scripting language, the computer needs to invoke the language’s interpreter.
Examples of scripting languages include Perl, Python and Tcl.
Developer Zone Tutorial: Introduction to Scripting in Perl, Python and Tcl
There are two ways run a script and invoke the interpreter for a scripting language:
Call the interpreter and pass the script file’s path as a command line argument
Register the script file’s extension to automatically invoke the interpreter. This is automatically done by some interpreter installers.
Both these options are detailed in the tutorial linked above.
Use the System Exec VI (Functions Palette » Connectivity » Libraries & Executables » System Exec) to run a script from LabVIEW. To run the script, call the interpreter using the System Exec VI, and pass in the script file path as a command line argument. Alternatively, if you have registered the script file’s extension with the interpreter, you can run the script directly by passing in the script file’s path to the Command Line input of the System Exec VI.