Main Content

Prepare for Real-Time Execution

To observe how Simulink® models respond to real-world behavior, connect the real-time application to physical I/O devices. You have access to a library of I/O driver blocks that provide connections between devices and applications. To prepare for real-time execution, install I/O devices in your computer and select the corresponding Simulink Desktop Real-Time™ library blocks.

Actions to consider when preparing for real-time execution include:

Prepare I/O Devices

  1. Choose I/O plugin modules from

  2. Acquire the modules and install them in your computer.

  3. Refer to the vendor documentation for vendor-specific requirements.

    If the hardware requires the installation of vendor software, install the vendor software on your computer.

  4. Restart your computer and, from the MATLAB® Command Window, start the Simulink Desktop Real-Time kernel.

Prepare Real-Time Application

  1. Replace Simulink I/O blocks with Simulink Desktop Real-Time blocks that represent the functionality of your I/O modules.

  2. Open the dialog box for each block and associate the block with the driver for the corresponding I/O module.

    Set the other block parameters as required by your model.

  3. To configure the model for Simulink Desktop Real-Time code generation, in the Simulink Editor, from the Apps tab, select Desktop Real-Time.

    This operation selects the sldrt.tlc code generation target and sets other configuration parameters for compatibility with Simulink Desktop Real-Time.

  4. Set the Simulink Desktop Real-Time configuration parameters as required by your model.

  5. If the performance of your model in Run in Kernel mode does not meet your system requirements, add Execution Time and Timestamp blocks for analysis. See Execution Time Measurement and Block Profiling.

The next step is to set the simulation mode to Connected IO mode or Run in Kernel mode to attain the required sample rate, and then run the simulation.

See Also


Related Topics

External Websites