Documentation

Real-Time Application Properties

Properties of real-time application and target computer

Provides access to the properties of the real-time application and the target computer.

To get the value of a readable target object property from a target object:

value = target_object.property_name

For example, to get the CommunicationTimeOut of the target object:

target_object = slrt;
value = target_object.CommunicationTimeOut

To set the value of a writable target object property from a target object:

target_object.property_name = new_value

For example, to set the CommunicationTimeOut of the target object:

target_object = slrt;
target_object.CommunicationTimeOut = 10

At the target computer command line, you can set the target object properties stoptime, sampletime, and writable parameters.

stoptime = floating_point_number
sampletime = floating_point_number
setpar parameter_index = parameter_value

Target Computer

expand all

This property is read-only.

Name of real-time application running on target computer, specified as a character vector. This name is the name of the Simulink® model from which the application was built. When the target computer starts, this value is 'loader'.

Communication timeout between the development and target computers, specified in seconds.

This property is read-only.

Communication status between the development and target computers, specified as character vector.

This property is read-only.

CPU status for overload, specified as a character vector. If the real-time application requires more CPU time than the model sample time provides, the kernel changes this value from 'none' to 'detected'. It then stops the current run. To keep this status from changing to 'detected', you must user a faster processor or specify a larger sample time.

This property is read-only.

Execution mode of the real-time application on the target computer, specified as a character vector. Parameter settings determine the execution mode during Simulink Coder™ code generation.

This property is read-only.

Time since the kernel started running on the target computer, specified in seconds. This time is also the elapsed time since you started the target computer.

Real-Time Execution

expand all

This property is read-only.

Average task execution time, specified in seconds.

Task execution time (TET) measures how long it takes the kernel to run for one base-rate time step. For a multirate model, use the profiler to find out what the execution time is for each rate.

Task execution time is nearly constant, with minor deviations due to cache, memory access, interrupt latency, and multirate model execution.

The TET includes:

  • Complete I/O latency.

  • Data logging for output, state, and TET, and the data captured in scopes.

  • Time spent executing tasks related to asynchronous interrupts while the real-time task is running.

  • Parameter updating latency. This latency is incurred if the Double buffer parameter changes parameter is set in the Simulink Real-Time Options node of the model Configuration Parameters dialog box.

The TET is not the only consideration in determining the minimum achievable sample time. Other considerations are:

  • Time required to measure TET.

  • Interrupt latency required to schedule and run one step of the model.

This property is read-only.

Execution time of real-time application since your real-time application started running, specified in seconds. When the real-time application stops, the kernel displays the total execution time.

This property is read-only.

Maximum task execution time, specified in seconds. Corresponds to the slowest time (longest measured time) required to update model equations and post outputs.

This property is read-only.

Minimum task execution time, specified in seconds. Corresponds to the fastest time (smallest measured time) required to update model equations and post outputs.

Time between samples (step size), in seconds, for updating the model equations and posting the outputs.

Note

Some blocks produce incorrect results when you change their sample time at run time. If you include such blocks in your model, the software displays a warning message during model build. To avoid incorrect results, change the sample time in the original model, and then rebuild and download the model.

See Limits on Sample Time.

This property is read-only.

Execution status of real-time application, specified as character vector.

Time when the real-time application stops running, specified in seconds or as character vector. The initial value is set in the Solver pane of the Configuration Parameters dialog box.

When the ExecTime reaches StopTime, the application stops running. If you specify the special value 'Inf', the real-time application runs until you manually stop it or restart the target computer.

This property is read-only.

Storage in the MATLAB workspace for task execution time, specified as a vector of double.

Signal Visualization

expand all

The values are the following meaning:

  • 'Normal' — Indicates time-equidistant logging. Logs a data point at every time interval.

  • Double — Indicates value-equidistant logging. Logs a data point only when an output signal from the OutputLog changes by the specified difference in signal value (increment).

This property is read-only.

Maximum number of samples for each logged signal, specified as an unsigned integer.

This property is read-only.

Number of times the circular data logging buffer wraps, specified as an unsigned integer. The buffer wraps each time the number of samples exceeds MaxLogSamples.

This property is read-only.

Number of observable signals in Simulink model, specified as an unsigned integer. Nonobservable signals are not included in this value.

Note

  • Signal access by signal index will be removed in a future release. Access signals by signal name instead.

  • This parameter will be removed in a future release.

This property is read-only.

Storage in MATLAB workspace for output or Y-vector, specified as a matrix.

This property is read-only.

List of index numbers, one per scope, specified as a vector of unsigned integers.

Flag set to view the list of signals from your Simulink model, specified as character vector. MATLAB displays the signal list when you display the properties for a target object.

This property is read-only.

List of observable signals, specified as a vector containing the following values for each signal:

  • Index — ID used to access the signal.

  • Value — Value of the signal.

  • Type — Data type of the signal.

  • Block name— Hierarchical name of the Simulink block that the signal comes from.

  • Label — Label that you have assigned to this signal.

This list is visible only when ShowSignals is set to 'on'.

This property is read-only.

Storage in MATLAB workspace for state or X-vector, specified as a matrix.

This property is read-only.

Storage in the MATLAB workspace for time or T-vector, specified as a vector of double.

Parameter Tuning

expand all

This property is read-only.

Number of tunable parameters in Simulink model, specified as an unsigned integer. Nontunable (nonobservable) parameters are not included in this value.

Note

  • Parameter access by parameter index will be removed in a future release. Access parameters by parameter name instead.

  • This parameter will be removed in a future release.

This property is read-only.

List of tunable parameters, specified as a vector containing the following values for each parameter:

  • Value — Value of the parameter in a Simulink block. If the parameter is a structure, the value is displayed with vector brackets.

  • Type — Data type of the parameter.

    Note

    Simulink Real-Time™ does not support parameters of multiword data types.

  • Size — Size of the parameter. For example, scalar, 1-by-2 vector, or 2-by-3 matrix, structure.

  • Parameter name — Name of the parameter in a Simulink block.

    If the parameter is a field of a structure, the name is displayed in the form structname.fieldname.

  • Block name — If the parameter is a block parameter, the block name is the hierarchical name of the Simulink block containing the parameter. If the parameter is a MATLAB variable that provides the value for a block parameter, the block name is the empty character vector.

This list is visible only when ShowParameters is set to 'on'.

Flag set to view the list of parameters from your Simulink model, specified as character vector. MATLAB displays the parameter list when you display the properties for a target object.

Profiler

expand all

The profiler states have the following meaning:

  • Ready — The profiler starts in this state and remains in it until the profiler runs.

    If the profiler runs, it reenters this state if the profiler:

    • Stopped without collecting data.

    • Collected data and the data was downloaded to the development computer.

    • Was reset.

  • Running — The command to start the profiler succeeded.

    If a real-time application is running, the profiler collects data.

    If a real-time application is not running, the profiler initializes and waits. When a real-time application starts, the profiler starts collecting data.

  • DataAvailable — The command to stop the profiler succeeded. The profiler collected data, but the data has not been downloaded to the development computer. In this state, an attempt to restart the profiler produces the following results:

    • If an application is running, calling this function returns an error. Download the data or reset the profiler before restarting it.

    • If an application is not running, calling this function restarts the profiler and prints a warning that the existing profile data is lost.

Introduced in R2014a

Was this topic helpful?