Calling MATLAB® Scripts on NI Real-Time Targets

Updated Nov 24, 2022

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?


You can use the MathScript Node of the LabVIEW MathScript Module 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.

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).