Main Content

Model Preparation for Real-Time Simulation

R2026b
Predefined and custom I/O driver blocks, code generation parameters, real-time kernel

A library of I/O driver blocks provides connections between physical I/O devices and real-time models. To observe how Simulink® models respond to real-world behavior, use the Simulink Desktop Real-Time™ block library to create a real-time application from a Simulink model. Set the model configuration parameters to values consistent with real-time execution. The real-time application runs on your computer with the Simulink Desktop Real-Time kernel. See Prepare for Real-Time Execution.

Functions

sldrtkernelInstall and remove Simulink Desktop Real-Time kernel
rtwhoDisplay information about development computer status
sldrtconfigsetAttach and activate default Simulink Desktop Real-Time configuration set
SLDRT.runRun model in real time by using Simulink Desktop Real-Time kernel (Since R2023b)
createTimerCreate timer in real-time kernel (Since R2023b)
loadExecutableLoad executable into real-time kernel (Since R2023b)
loadDriverLoad driver instance into real-time kernel (Since R2023b)
stopStops execution of current model simulation run and causes MATLAB to wait until execution stops (Since R2023b)
waitWait for model execution to complete (Since R2023b)

Objects

SLDRT.RunStatusGet simulation run status and get data from scopes and logged signals (Since R2023b)
RT.KernelGet real-time kernel property information and access child object for timers, executables, and drivers (Since R2023b)
RT.TimerRepresent timer in real-time kernel (Since R2023b)
RT.ExecutableRepresent executable in real-time kernel (Since R2023b)
RT.DriverRepresent device driver in real-time kernel (Since R2023b)
RT.DriverImageRepresent a binary image of device driver for real-time kernel (Since R2023b)

Tools

Board setupOpen a board-specific dialog box to set up the data acquisition board for Simulink Desktop Real-Time

Blocks

expand all

Analog Input blockAnalog InputRead from one or multiple analog input channels
Analog Output blockAnalog OutputWrite to one or multiple analog output channels
Counter Input blockCounter InputRead from one or multiple counter-input channels
Encoder Input blockEncoder InputRead from one or multiple incremental encoder input channels
Frequency Output blockFrequency OutputWrite to one or multiple frequency or PWM output channels
Digital Input blockDigital InputRead from one or multiple digital input channels
Digital Output blockDigital OutputWrite to one or multiple digital output channels
ThingSpeak Input blockThingSpeak InputRead input fields from ThingSpeak channel
ThingSpeak Output blockThingSpeak OutputWrite output fields to ThingSpeak channel
Packet Input blockPacket InputRead binary data or a CAN message from a communication channel
Packet Output blockPacket OutputWrite binary data or a CAN message to a communication channel
Servo Output blockServo OutputWrite to standard servo output channels
Stream Input blockStream InputRead formatted ASCII data from communication channel
Stream Output blockStream OutputWrite formatted ASCII data to communication channel
Other Input blockOther InputRead from one or more input channels not handled by specific blocks
Other Output blockOther OutputWrite to one or more output channels not handled by specific blocks
Real-Time Sync blockReal-Time SyncSynchronize model execution to real time in Connected IO mode
Execution Time blockExecution TimeOutput total execution time in Run in Kernel mode or Priority mode
Timestamp blockTimestampOutput signal timestamp in Run in Kernel mode or Priority mode
Video Input blockVideo InputGet video data from system video devices (Since R2022a)

Topics

Prerequisites

Configuration

Related Information

Featured Examples