Simulink Real-Time Code Generation
To perform hardware-in-the-loop simulation on target hardware, use Simulink® Real-Time™ to:
Generate and compile code on the development computer.
Download the real-time application to the target computer.
Execute the real-time application remotely from the development computer.
Requirements for Building and Executing Simulink Real-Time Applications
Before building and executing your real-time application:
Prepare and configure your model for real-time simulation. For information, see Model Preparation Process and Fixed-Cost Simulation Process.
Set up and configure the software, I/O interfaces, and connectivity for your development computer, target computer, and I/O board. For information, see Get Started with Simulink Real-Time (Simulink Real-Time).
Create, Build, Download, and Execute a Real-Time Application
For an example that shows you how to generate code for the model on your development computer, transfer the code to your real-time computer, and execute the code on your real-time computer, see Create and Run Real-Time Application from Simulink Model (Simulink Real-Time).
Hardware Requirements
The minimum hardware requirements for HIL simulation with Simulink Real-Time are:
Development computer with a network or serial interface. For information on development computer specifications, see Development Computer Requirements (Simulink Real-Time).
Real-time target computer system, containing this hardware:
CPU.
I/O board. For information on supported I/O boards, see Supported Hardware: Hardware Drivers.
Protocol interface
Controller, preconfigured with code from your controller model
Connection cable for linking the development computer to the real-time target machine.
Peripherals that provide a way to:
Boot the real-time target computer
Transfer the Simulink Real-Time operating system and executable code to the real-time target computer
Wiring harness to connect the real-time target computer to the controller.
Software Requirements
For information on the minimum software requirements for HIL simulation with Simulink Real-Time, see Simulink Real-Time Software Requirements. The Simulink Real-Time requirements include a C compiler.
Note
If you want more configuration options for code optimization, use Embedded Coder® to generate code for your real-time computer. For information, see Embedded Coder Product Description (Embedded Coder).
See Also
Simulink Real-Time Explorer (Simulink Real-Time)
Related Examples
- Set Up and Configure Simulink Real-Time (Simulink Real-Time)
- Create and Run Real-Time Application from Simulink Model (Simulink Real-Time)