MATLAB: Running Matlab code on an industrial PC

industrial pc

At a remote site, we will have an industrial PC that must read incoming measurements and process them. Communication to the industrial PC will be unreliable so it must execute the code itself. I am presently writing an algorithm in Matlab to process the measurements. But getting the Matlab code to run in near real-time on the industrial PC is a new task for me and my coworkers. Questions:
  1. Can I simply install Matlab on the industrial PC and run my code?
  2. If not, what are the components of a basic stand-alone real-time system?
  3. How do I choose an industrial PC that can run my code fast enough? Can I run the code on my machine with simulated measurements to get metrics that will define what to look for in an industrial PC?

Best Answer

What kind of data rates are you wanting to process, and how close to real-time do you need?
MATLAB can be installed on MS Windows, Linux, or Mac OS-X. If your industrial PC has a Real-Time Operating System (RTOS) such as QNX, then you will not be able to install MATLAB itself on it.
Normally if you want anything approaching "real-time" you would use a Real-Time Operating System (RTOS) on the Industrial PC, and you would use MATLAB Builder or Simulink Builder to create C or C++ code that would then be compiled for the industrial PC and the executable copied there.
The two Builder products require MATLAB Compiler as a base, and the Fixed Point Toolbox is usually also recommended.
There are a lot of restrictions on what can be built using the Builder products -- for example, no cell arrays.