LabVIEW 2012 MathScript RT Module Help
»View Product Info
You cannot execute MathScript functions directly. In other words, you first must define and save a function before you can call the function with inputs and outputs in the LabVIEW MathScript Window or the MathScript Node. Complete the following steps to create a function or script and prepare it for use in the LabVIEW MathScript Window or MathScript Node.
Caution If you define a function with the same name as a built-in MathScript RT Module function, LabVIEW executes the function you defined instead of the original function. When you execute the help command, LabVIEW returns help content only for the function you defined. You cannot retrieve the help content for the original MathScript RT Module function.|
- In the Script Editor on the Script page of the LabVIEW MathScript Window, create a function or script using the proper syntax. You also can use a text editor to create the function or script.
||Note To open a new Script Editor in a separate window, select File»New Script Editor or right-click the Script Editor on the Script page and select New Script Editor from the shortcut menu.
- Save the function or script. The filename for a function must be the same as the name of the function and must have a lowercase .m extension. For example, the filename for the foo function must be foo.m. Use unique names for all functions and scripts. You must save the function or script in a directory in the MathScript search path.
Note If you define a function with the same name as a built-in MathScript RT Module function and want to revert to the original function, either delete the function you defined, rename the function you defined to a name that is different from the built-in MathScript RT Module function, or remove the path that contains the function you defined from the default search path list. After you remove the path, LabVIEW no longer loads the function you defined into memory because the list LabVIEW searches does not include the path to the function.|
After you define and save a function, you can call the function you defined from the LabVIEW MathScript Window or the MathScript Node.