Hauptinhalt

Troubleshoot MATLAB API Call Upgrade

In R2020b and later releases, many objects and functions in the Simulink® Real-Time™ API differ from these API calls in R2020a and previous releases.

What This Issue Means

MATLAB® 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 R2020b and later releases and identify new workflows. Use these tables to guide your updates to pre-R2020b MATLAB scripts. For information about 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

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

slrealtime.Application object, ApplicationName property

slrealtime.target object, Application property

Get name of real-time application.

Changed name

Use Target object, Application property.

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

Get communication status between development computer 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

See the speedgoat.getDiskSpace function at Speedgoat customer portal.

load function

Download real-time application to target computer.

Name 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.

Name unchanged

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

saveparamset

Save a set of parameters to a real-time application.

Changed name and changed workflow

Use saveParamSet to save the parameter set to a file.

loadparamset

Load a set of saved parameters to a real-time application.

Changed name and changed workflow

Use importParamSet to import the parameter set into a ParameterSet object on the development computer.

Real-Time Execution Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

slrealtime.target object, CPUoverload property

Get CPU overload status.

Changed name

Use Target object, TargetStatus property or ModelStatus property.

slrealtime.target object, AvgTET property

Get average task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

slrealtime.target object, ExecTime property

Get real-time application execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

slrealtime.target object, MaxTET property

Get maximum task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

slrealtime.target object, MinTET property

Get minimum task execution time.

Changed name

Use Target object, ModelStatus.TETInfo property.

slrealtime.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 use added function arguments to set real-time application options.

slrealtime.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.

Name unchanged

Use stop function.

slrealtime.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.

slrealtime.target object, TETLog property

Access storage in the MATLAB workspace for task execution time.

Changed workflow

Use slrtTETMonitor function.

Execution Profiler Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

getProfilerData function

Retrieve profile data object.

Name unchanged

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

slrealtime.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.

Name unchanged

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

startProfiler function

Start profiling service on target computer.

Name 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 autostop at 1 GB is eliminated.

Parameter Tuning Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew 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.

slrealtime.target object, NumParameters property

Get number of tunable parameters.

Changed workflow

Use Application object and getParameters function.

slrealtime.target object, Parameters property

Get list of tunable parameters.

Changed workflow

Use Application object and getParameters function.

slrealtime.target object, ShowParameters property

Set flag to display the list of parameters.

Changed workflow

Use Application object and getParameters function.

Signal Tracing Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

getsignal function

Get single numerical value of a signal.

Changed workflow

Use Instrument object and connectScalar function.

slrealtime.target object, NumSignals property

Get number of observable signals.

Changed workflow

Use Application object and getSignals function.

slrealtime.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)

slrealtime.target object, ShowSignals property

Set flag to display the list of signals.

Changed workflow

Use Application object and getSignals function.

slrealtime.target object, Signals property

Get list of observable signals.

Changed workflow

Use Application object and getSignals function.

Signal Logging Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew 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

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

addscope function

Create a scope of specified type.

Replaced

Use the Simulation Data Inspector.

Use File Log blocks instead File Scope blocks.

Use Instrument objects 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 Instrument objects instead of Host Scope blocks.

Ethernet and EtherCAT Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

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

Configure Ethernet ports on target computer.

Moved to Speedgoat API

See the speedgoat.configureEthernet function at Speedgoat customer portal.

slrealtime.etherCAT.filterNotifications function

Display EtherCAT notifications in human-readable format.

Changed name

Use slrealtime.EtherCAT.filterNotifications function.

Target Computer Settings Operations

Command in R2020a and Previous ReleasesCommand DescriptionCommand in R2020b and Later ReleasesNew Workflow

slrealtime.getTargetSettings function

Get target computer settings.

Changed name

Use getTargetSettings function.

See Also

Topics