Calling MATLAB® Scripts on NI Real-Time Targets

Updated Aug 28, 2023

Reported In


  • CompactRIO Controller


  • LabVIEW MathScript Module

Issue Details

Can I run a MATLAB® Script (.m file) on NI Real-Time targets, such as a CompactRIO?


If you had previously purchased the LabVIEW MathScript Module, you can use the MathScript Node to run the instructions contained in your .m file on an NI Real-Time target.

Refer to Using MathScript Node in LabVIEW for information on how to use the MathScript Node. However, the LabVIEW MathScript Module is no longer offered by NI. LabVIEW MATLAB Script nodes are recommended as an alternative to LabVIEW MathScript nodes for Windows computers. 

Additional Information

There are certain MathScript functions that are not supported on Real-Time targets, you can find additional details in: Support for MathScript Functions in Real-Time Applications.

Depending on the functions, data types, and syntax used, LabVIEW might execute code at run time that can cause increased jitter and unbounded execution times in a real-time application. When determinism in an application is important refer to the Guidelines for Using LabVIEW MathScript in Real-Time Applications (MathScript RT Module).