Hello,
The title of your post asks about using Xmath script. Is this what you intended? You can use the Xmath script node in LabVIEW if you have MATRIXx 7.x or earlier installed. However, the syntax is slightly different from the syntax of The MathWorks, Inc. MATLAB® software.
In LabVIEW 8.0, we introduced LabVIEW MathScript. The LabVIEW MathScript syntax is similar to the MATLAB language syntax. In LabVIEW MathScript, you generally can execute scripts written in the MATLAB language syntax. However, the MathScript engine executes the scripts, and the MathScript engine does not support some functions that the MATLAB software supports. In order to reuse code that you have written, open the MathScript Window by going to Tools >> MathScript Window. You can also use the MathScript node as part of a VI you are writing. You can find the node on the Programming >> Structures palette. You can import an existing script by right-clicking the node and selecting "Import..." You can create inputs and outputs for the script by right-clicking on the node and selecting the appropriate option. If you wish to call any functions you have written, put them in the MathScript search path. By default, this is your "My Documents\LabVIEW Data" folder. In LabVIEW 8.5, you can change the default search path for the main application instance by going to Tools >> Options.
LabVIEW MathScript does not contain very many GUI functions at this time. You can use the VI's front panel as your GUI, though, and interact with your program that way. Let me know if you have other questions about moving your code or about specific functions.
MATLAB® is a registered trademark of The MathWorks, Inc.
Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments