Test your math script in MATLAB® to verify its functionality before using it in a MATLAB script nodes. Set up data and error monitoring in your VI to display errors during the operation of your script.

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 LabVIEW and the script server engine are passing each other. 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 before you run any VI so you can view the generated error information at run time.