Use script nodes to execute math scripts in LabVIEW. LabVIEW provides a script node called the MATLAB® script node, that facilitates the processing of your scripts written in the MATLAB language syntax.
To make debugging a script easier, use the following programming techniques:
Write the script and run it in the native program for testing and debugging purposes before you import it into LabVIEW.
Verify data types. When you create a new input or output, make sure that the data type of the terminal is correct. Also, create controls and indicators for inputs and outputs so you can monitor what values are being passed between LabVIEW and the script server engine. This allows you to pinpoint where a script node calculates a value incorrectly, if necessary.
Take advantage of the error-checking parameters for debugging information. Create an indicator for the error out terminal on a MATLAB script node or a (MathScript RT Module)MathScript Node before you run any VI so you can view the generated error information at run time.