Main Content

Troubleshoot MATLAB API Call Upgrade for R2020b

In R2020b, many objects and functions in the Simulink® Real-Time™ API changed.

What This Issue Means

MATLAB® m-scripts written by using the Simulink Real-Time API require updates to run in R2020b and later releases.

Try This Workaround

These tables identify Simulink Real-Time API changes in R2020 and identify new workflows. Use these tables to guide your updates to pre-R2020b m-scripts. For information about Simulink Real-Time in previous releases, see:

https://www.mathworks.com/help/doc-archives.html

Target Computer Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

SimulinkRealTime.Application object, ApplicationName property

SimulinkRealTime.target object, Application property

Get name of real-time application.

Changed name

Use Target object, Application property.

SimulinkRealTime.target object, Connected property value is 'Yes'.

Get communication status between development and target computers.

Changed name

Use Target object, Connected event.

Use connect function to make connection.

close function

Close connection between development and target computers.

Changed name

Use disconnect function to close connection.

getDiskSpace function

Get free space and total space on the drive, in bytes.

Moved to Speedgoat API

Use speedgoat.getDiskSpace function.

load function

Download real-time application to target computer.

Unchanged

Use load function after creating Target object. The real-time application is not automatically loaded as part of the build process.

reboot function

Restart target computer.

Unchanged

Use reboot function to restart target computer in standalone mode. Other, previously supported boot modes are not available.

Real-Time Execution Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

SimulinkRealTime.target object, CPUoverload property

Get CPU overload status.

Changed name

Use Target object, TargetStatus property or ModelStatus property.

SimulinkRealTime.target object, AvgTET property

Get average task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

SimulinkRealTime.target object, ExecTime property

Get real-time application execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

SimulinkRealTime.target object, MaxTET property

Get maximum task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

SimulinkRealTime.target object, MinTET property

Get minimum task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

SimulinkRealTime.target object, SampleTime property

Get time between samples (step size).

Changed name

Use Target object, ModelStatus.TETInfo.Rate property.

start function

Start execution of real-time application on target computer.

Changed workflow

Use start function to start real-time application and set real-time application options.

SimulinkRealTime.target object, Status property

Get execution status of real-time application.

Changed workflow

Use Target object, ModelStatus property or status function.

stop function

Stop execution of real-time application on target computer.

Unchanged

Use stop function.

SimulinkRealTime.target object, StopTime property

Get or set time when real-time application stops running.

Changed workflow

Get by using Target object, ModelStatus.StopTime property and set by using setStopTime function.

SimulinkRealTime.target object, TETLog property

Access storage in the MATLAB workspace for task execution time.

Changed workflow

Use slrtTETMonitor function.

Execution Profiler Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

getProfilerData function

Retrieve profile data object.

Unchanged

Use getProfilerData function. Start the execution profiler before you start the real-time application.

SimulinkRealTime.target object, ProfilerStatus property

Get state of profiler.

Changed workflow

Use Target object, Application property. There are added property values.

resetProfiler function

Reset profiling service state to Ready.

Unchanged

Use resetProfiler function. The profiler resets itself when you start the real-time application.

startProfiler function

Start profiling service on target computer.

Unchanged

Use startProfiler function. Start the execution profiler before you start the real-time application.

stopProfiler function

Stop profiling service on target computer.

Changed limitation

Use stopProfiler function. The profiler auto stop at 1GB is eliminated.

Parameter Tuning Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

setparam function

Change value of tunable parameter in real-time application.

Changed syntax

Use setparam function.

getparam function

Read value of observable parameter in real-time application.

Changed syntax

Use getparam function.

SimulinkRealTime.target object, NumParameters property

Get number of tunable parameters.

Changed workflow

Use Application object and getParameters function.

SimulinkRealTime.target object, Parameters property

Get list of tunable parameters.

Changed workflow

Use Application object and getParameters function.

SimulinkRealTime.target object, ShowParameters property

Set flag to display the list of parameters.

Changed workflow

Use Application object and getParameters function.

Signal Tracing Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

getsignal function

Get single numerical value of a signal.

Changed workflow

Use Instrument object and connectScalar function.

SimulinkRealTime.target object, NumSignals property

Get number of observable signals.

Changed workflow

Use Application object and getSignals function.

SimulinkRealTime.target object, OutputLog property

Access storage in MATLAB workspace for output or Y-vector.

Changed workflow

Use Simulink model Signal logging parameter:

set_param(bdroot,...
'SignalLogging','on')

SimulinkRealTime.target object, ShowSignals property

Set flag to display the list of signals.

Changed workflow

Use Application object and getSignals function.

SimulinkRealTime.target object, Signals property

Get list of observable signals.

Changed workflow

Use Application object and getSignals function.

Signal Logging Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

importLogData function

Import buffered logging data to the active session of the Simulation Data Inspector.

Replaced

Use list function and import function. For more information, see the Target.FileLog object.

Instrumentation Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

addscope function

Create a scope of specified type.

Replaced

Use the Simulation Data Inspector.

Use File Log blocks instead File Scope blocks.

Use Instrumentobjects instead of Host Scope blocks.

getscope function

Return scope identified by scope number.

Replaced

Use the Simulation Data Inspector.

Use File Log blocks instead File Scope blocks.

Use Instrumentobjects instead of Host Scope blocks.

Ethernet and EtherCAT Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

Target Computer Settings provided information about Ethernet setup on target computer.

Configure Ethernet ports on target computer

Moved to Speedgoat API

Use speedgoat.configureEthernet function

SimulinkRealTime.etherCAT.filterNotifications function

Display EtherCAT notifications in human-readable format

Changed name

Use slrealtime.EtherCAT.filterNotifications function

Target Computer Settings Operations

R2020a and Previous CommandCommand DescriptionR2020b and Later Command StatusNew Workflow

SimulinkRealTime.getTargetSettings function

Get target computer settings.

Changed name

Use getTargetSettings function.

See Also

Related Topics