Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

MathScript Node (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

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 on the MathScript Node frame.

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:

  1. Remove these functions from scripts and user-defined functions.
  2. Remove references to user-defined scripts. Instead, copy the contents of the user-defined script into the MathScript Node or the user-defined function that calls the script.
  3. Do not change the MathScript search path list at run time. Instead, use the MathScript: Search Paths Options page to configure the default search path list.
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.

Examples

Refer to the following VIs for examples of using the MathScript Node:

  • MathScript Fractal VI: labview\examples\MathScript
  • MathScript Fundamentals VI: labview\examples\MathScript
  • MathScript using Riemann Zeta VI: labview\examples\MathScript\MathScript using Riemann Zeta

Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit