Skip to main content
Documentation
CONTENTS

Simulink Real-Time Environment

Simulink Real-Time Environment — About Simulink Real-Time

Communicate with the target

Once Windows network settings, MATLAB network and kernel settings, and kernel configuration loaded in the target machine correspond with each other the development computer and target machine are ready to communicate with each other.

In MATLAB type slrtpingtarget to test the communication. If the command returns success, all settings are correctly configured.

As the target machine uses a standard TCP/IP network configuration, you can also ping the target machine's IP address from the Windows Command prompt, e.g.: ping 192.168.7.1

Preparing a model for Simulink Real-Time

To create a new model from scratch, you can proceed as follows:

  1. Create a new Simulink model

  2. Open the model Configuration Parameters

    Use CTRL+E, or click the toolbar button

  3. Configure the model

    Solver pane

    • Stop time: insert a numeric value (in seconds) or 'inf' for a never-ending real-time execution

    • Type: Fixed-step

    • Solver: select an appropriate solver, or discrete (no continuous states)

    • Fixed-step size: you can define here a sample time, or "auto" in case the sample time is defined in the Simulink model blocks

    • Tasking mode for periodic sample times: you can force a Single-tasking or Multi-tasking application, or just "auto"

      Code Generation pane

    • System target file: slrt.tlc

  4. Design and save the Simulink model

  5. Build the model

    Use CTRL+B or click the button:

  6. The application will be automatically downloaded to the target machine.

    You can control the real-time application by using the Simulink Real-Time Explorer (slrtexplr) or via the MATLAB command line, by using the target object (default tg). For further information see Create and Run Real-Time Application from Simulink Model or Create and Run Real-Time Application from Simulink Model (web)

Speedgoat Library

Speedgoat develops and maintains functions and driver blocks for Simulink Real-Time including driver blocks for placing into your Simulink models. Typically, there is a setup block for each I/O module to configure the main parameters, and additional driver blocks to configure input and output channels or communication messages through dialog fields.

Once the Speedgoat Library has been installed, you can access driver blocks by typing speedgoatlib at the MATLAB command prompt:

Additional tools and drivers are accessible via the MathWorks library (type slrtlib at the command prompt):

Data Logging and File Transfer

Simulink Real-Time provides functionality to log data during real-time execution on the main drive of your target machine. Further information on how to configure and use the Simulink Real-Time software for data logging is provided in Signal Logging with Simulink Real-Time Explorer or Signal Logging with Simulink Real-Time Explorer (web).