Owning Palette: Scripts & Formulas VIs
Installed With: Full Development System
Executes LabVIEW MathScripts. You can use the MathScript Node to evaluate scripts that you create in the LabVIEW MathScript Window. The LabVIEW MathScript syntax is similar to the MATLAB® language syntax.

Use this node to execute scripts. Enter the script in the node or right-click the node border to import text into the node. Right-click the node border to add input and output variables. Right-click an output variable to set its data type. When you create a LabVIEW MathScript, you must use supported data types.
![]() | Note The MathScript Node and the LabVIEW MathScript Window can communicate only if they are in the same application instance. |
If you call a function from a MathScript Node that might change the MathScript search path list at run time or might introduce new variables at run time, a warning glyph, shown as follows, appears next to the line from which you call the function.
The warning glyph indicates that LabVIEW operates with reduced error checking and slower run-time performance for the MathScript Node. The following functions cause the warning glyph to appear: addpath, cd, clear, eval, evalc, load, path, rmpath, and uiload. The cd function and the path function cause the warning glyph to appear only if you call these functions with one or more inputs. The warning glyph also appears if you call a user-defined function that calls any of these functions, if you call a user-defined script, or if you call a user-defined function that calls a user-defined script. To remove the warning glyph from the MathScript Node and improve run-time performance, complete the following steps:
![]() | Note If a script in a MathScript Node calls a user-defined function, LabVIEW uses the default search path list to link the function call to the specified .m file. After you configure the default search path list and save the VI that contains the MathScript Node, you do not need to reconfigure the MathScript search path list when you open the VI on a different computer because LabVIEW looks for the .m file in the directory where the .m file was located when you last saved the VI. However, you must maintain the same relative path between the VI and the .m file. |
The LabVIEW Run-Time Engine does not support MathScript Nodes with warning glyphs. If a VI includes a MathScript Node with a warning glyph, you must remove the warning glyph from the MathScript Node before you build a stand-alone application or shared library. The LabVIEW Run-Time Engine also does not support certain MathScript functions. To include a MathScript Node in a stand-alone application or shared library, you might need to modify scripts that contain these unsupported functions.
Refer to the following VIs for examples of using the MathScript Node: