slrealtime.ui Properties
Using these properties, you can customize the appearance and operation of
slrealtime.ui.control controls and slrealtime.ui.tool
tools.
Component Operation
This property is available for each of the Simulink Real-Time components. The
property selects whether the component is enabled (true) or disabled (false) when the
app runs. For graphical (non Simulink Real-Time) components that are configured with a
Simulink Real-Time ParameterTuner, you can use the Enable property on
the ParameterTuner to enable or disable the graphical component.
When true, the
ParameterTunersets or clearsEnableproperty of the graphical component based on state of target computer.When false, the
ParameterTunersets theEnableproperty of theParameterTunercomponent to false but continues to update the graphical component. In this way, theParameterTunerEnableproperty acts as an enable property for the graphical component.
Example: k = uiknob; pt = slrealtime.ui.tool.ParameterTuner; pt.Component =
k; pt.Enable = false;
Data Types: logical
Position and Size
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
h.Position = [0 0 200 200]
Data Types: integer array
This property applies to the slrealtime.ui.control button
controls. For more information, see the property description in Button.
Example: 'left'
Data Types: string
This property applies to the slrealtime.ui.control button
controls. For more information, see the property description in Button.
Example: 'center'
Data Types: string
This property applies to the slrealtime.ui.control button
controls. For more information, see the property description in Button.
Example: 'center'
Data Types: string
Component Appearance
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
'Helvetica'
Data Types: system supported font name
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example: 12
Data Types: positive number
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
'normal'
Data Types: string
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
'normal'
Data Types: string
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
0 0 0
Data Types: RGB triplet
This property applies to all slrealtime.ui.control controls. For
more information, see the property description in Figure object properties.
Example:
[0.96 0.96 0.96]
Data Types: RGB triplet
Event Manager Component
This property applies to the slrealtime.ui.tool.EventManager
component. Use this property to add a structure of event names and callback function
handles to be managed.
The struct has Event and Callback fields. Each
Event is a string that is a target computer event. Each
Callback is a function handle that takes two arguments
(object, event). For more information about event listeners, see
Overview Events and Listeners.
Example:
hTgEventManager.EventCallbacks = struct('Event', {'ParamChanged'}, 'Callback',
{matlab.apps.createCallbackFcn(hFig, @ParamChanged, true)});
Data Types: array of Instrument objects
Instrument Manager Component
This property applies to the slrealtime.ui.tool.InstrumentManager
component. Use this property to add Instrument objects to the array of managed instruments. The Instrument objects are bound to one or more UI components.
Example:
[hInstAxes hInstGauge]
Data Types: array of Instrument objects
Connect Button Component
This property applies to the slrealtime.ui.control.ConnectButton
component. The property selects the icon that is displayed on the button in the
connected state.
Example: 'slrtConnectIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.ConnectButton
component. The property selects the icon that is displayed on the button in the
disconnected state.
Example: 'slrtDisconnectIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.ConnectButton
component. The property selects the text that is displayed on the button in the
connected state.
Example: 'Connected'
Data Types: string
This property applies to the slrealtime.ui.control.ConnectButton
component. The property selects the text that is displayed on the button in the
disconnected state.
Example: 'Disconnected'
Data Types: string
The callback code for the PreConnectFcn function executes before
the ConnectButton component issues a connect(tg)
command.
Example: disp('Connecting to target computer')
The callback code for the PostConnectFcn function executes after
completion of the connect(tg) command from the
ConnectButton component.
Example: disp('Connected to target computer')
The callback code for the PreDisconnectFcn function executes
before the ConnectButton component issues a
disconnect(tg) command.
Example: disp('Disconnecting from target computer')
The callback code for the PostDisconnectFcn function executes
after completion of the disconnect(tg) command from the
ConnectButton component.
Example: disp('Disconnected from target computer')
Import File Log Button Component
The callback code for the PreImportFcn function executes before
the ImportFileLogButton component issues a
import(tg.FileLog) command.
Example: disp('Importing file log from target
computer')
The callback code for the PostImportFcn function executes after
completion of the import(tg.FileLog) command from the
ImportFileLogButton component.
Example: disp('Imported file log from target
computer')
Load Button Component
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects whether the button displays the name of the loaded
real-time application in the loaded state.
Example: true
Data Types: logical
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects the icon that is displayed on the button.
Example: 'slrtLoadIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects the text that is displayed on the button.
Example: 'Load Application'
Data Types: string
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects whether the button action skips installation and just
loads the real-time application.
Example: false
Data Types: logical
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects whether the button action that loads the real-time
application is asynchronous (does not block) MATLAB operation.
Example: false
Data Types: logical
This property applies to the slrealtime.ui.control.LoadButton
component. The property selects the application that loads when you click the button. If
set, the button loads the specified application instead of opening a dialog box to
select an application.
Example: 'myApplication'
Data Types: string
The callback code for the PreLoadFcn function executes before the
LoadButton component issues a load(tg)
command.
Example: disp('Loading MLDATX file on target
computer')
The callback code for the PostloadFcn function executes after
completion of the load(tg) command from the
LoadButton component.
Example: disp('Loaded MLDATX file on target
computer')
Latch and Momentary Button Components
This property applies to the slrealtime.ui.control.LatchButton
and slrealtime.ui.control.MomentaryButton component. The property
identifies a parameter that is specified by block path and parameter name.
Example:
'testmodel/Constant6'
Data Types: string
This property applies to the slrealtime.ui.control.LatchButton
and slrealtime.ui.control.MomentaryButton components. The property
identifies a parameter that is specified by block path and parameter name.
Example:
'Value'
Data Types: string
This property applies to the slrealtime.ui.control.LatchButton
and slrealtime.ui.control.MomentaryButton components. The property
selects the value that the button downloads when the button is in the ON state. If the
OnValue value type of does not match the parameter value type on
the target computer, it is converted to the parameter value type on the target computer.
If conversion is not possible, an error is reported.
Example: 1
Data Types: double | int | fixedpoint
The callback code for the PreButtonDownFcn function executes
before the LatchButton or MomentaryButton
component executes the buttonPressed callback function.
Example: disp('Button press detected in app')
The callback code for the PostButtonDownFcn function executes
after the LatchButton or MomentaryButton component
executes the buttonPressed callback function.
Example: disp('Button press detected in app')
The callback code for the PreButtonUpFcn function executes before
the LatchButton or MomentaryButton component
executes the buttonUnpressed callback function.
Example: disp('Button press release in app')
The callback code for the PostButtonUpFcn function executes after
the LatchButton or MomentaryButton component
executes the buttonUnpressed callback function.
Example: disp('Button press release in app')
Menu Component
For property information, see AsyncLoad description. For an example applying this property for the
slrealtime.ui.container.Menu component, see Create Menu by Using App Generator
Example: 0
Data Types: logical
For property information, see AutoImportFileLog description. For an example applying this property for
the slrealtime.ui.container.Menu component, see Create Menu by Using App Generator
Example: 0
Data Types: logical
For property information, see ExportToBaseWorkspace description. For an example applying this property
for the slrealtime.ui.container.Menu component, see Create Menu by Using App Generator
Example: 0
Data Types: logical
For property information, see ReloadOnStop description. For an example applying this property for the
slrealtime.ui.container.Menu component, see Create Menu by Using App Generator
Example: 1
Data Types: logical
For property information, see SkipInstall description. For an example applying this property for the
slrealtime.ui.container.Menu component, see Create Menu by Using App Generator
Example: false
Data Types: logical
Parameter Set Button Component
This property applies to the
slrealtime.ui.control.ParameterSetButton component. The property
selects the icon that is displayed on the button.
Example: 'slrtParameterSetIcon.png'
Data Types: string
This property applies to the
slrealtime.ui.control.ParameterSetButton component. The property
selects the text that is displayed on the button.
Example: 'Parameter Set'
Data Types: string
Parameter Table and Signal Table Component
This property applies to the slrealtime.ui.control.ParameterTable
and slrealtime.ui.control.SignalTable controls. For more information,
see the RGB triplet table the property description in Figure object properties.
Example:
[0 0 0]
Data Types: RGB triplet
This property applies to the slrealtime.ui.control.ParameterTable
and slrealtime.ui.control.SignalTable controls. For more information,
see the RGB triplet table in the property description in Figure object properties.
Example:
[1 1 1]
Data Types: RGB triplet
This property applies to the slrealtime.ui.control.SignalTable
control. The Signals property value is a struct that contains
fields:
BlockPath— provides either the full block path or name for each signal.The
PortIndex— provides either the port index value (for signals identified by block path) or the value-1(for signals identified by name).Decimation— provides a decimation value for each signal. Default values is1.ArrayIndex— provides an array index for each signal. Default values is[].BusElement— provides bus element selection for each signal. Default values is[],'', or"".Callback— provides callback code for each signal. Default values is[].
hSTable.Signals = struct( ...
'BlockPath', {'testmodel/Constant1', 'testmodel/Constant2', ...
'Sine', 'String', 'testmodel/Switch1'}, ...
'PortIndex', {1, 1, -1, -1, 1}, ...
'Decimation', {1, 2, 5, 1, 1}, ...
'ArrayIndex', {[], [], 2, [2 2], 3}, ...
'BusElement', {'', 'b', '', 'z', 'a'}, ...
'Callback', {[], cb, [], [], []});Example:
struct
Data Types: struct
This property applies to the slrealtime.ui.control.ParameterTable
control. The Parameters property value is a struct that contains
fields BlockPath and ParameterName. The
BlockPath field provides the full block path for each parameter in
the table. The ParameterName field provides the parameter name for
each parameter in the table. When using workspace variables in the
Parameters property, the BlockPath is empty for
the workspace variable, and the ParameterName value is the name of
the workspace variable.
hPTable.Parameters = struct( ...
'BlockPath', {'testmodel/Constant1', '', ...
'testmodel/Constant5', '', ...
'testmodel/str1', 'testmodel/str2', ...
'testmodel/multi-line block name', ...
'testmodel/Constant6'}, ...
'ParameterName', {'Value', 'model_wksp_var', ...
'Value', 'base_wksp_var', 'String', ...
'String', 'Value', 'Value'}); Example:
struct
Data Types: struct
Parameter Tuner Component
This property applies to the slrealtime.ui.tool.ParameterTuner
component. The property identifies the underlying App Designer component connected to
the parameter tuner.
Example:
hKnob
Data Types: graphic object
This property applies to the slrealtime.ui.tool.ParameterTuner
component. The property identifies a parameter that is specified by block path and
parameter name.
Example:
'testmodel/Constant6'
Data Types: string
This property applies to the slrealtime.ui.tool.ParameterTuner
component. The property identifies a parameter that is specified by block path and
parameter name.
Example:
'Value'
Data Types: string
This property applies to the slrealtime.ui.tool.ParameterTuner
component. Use this property to convert a parameter value to a value used by the
component Value property.
The ConvertToComponent property must be a function handle that
accepts one argument and returns one value. When a value changes on the target computer,
the real-time application uploads the new value to the app to keep the components in
sync with the real-time application. The ConvertToComponent
property manipulates the value from the target computer into a value that is suitable
for writing to the Value property of the component.
For example, you can convert a fixed-point value to a double. For a code example, see Apply ConvertToTarget and ConvertToComponent Properties.
Example:
@app.convToDouble
Data Types: object handle
This property applies to the slrealtime.ui.tool.ParameterTuner
component. Use this property to convert a component value to a value used by the
real-time application on the target computer.
The ConvertToTarget property must be a function handle that
accepts one argument and returns one value. When the uicontrol
changes the value, the app downloads the value to the corresponding parameter. If the
ConvertToTarget property is non-empty, the app executes the
function handle, passes in the new value, and uses the return value to download to the
parameter. This operation provides an opportunity to apply value manipulation before
downloading.
For example, you can convert discrete knob states to integer values. For a code example, see Apply ConvertToTarget and ConvertToComponent Properties.
Example:
@app.convertedInt
Data Types: object handle
Reboot Button Component
This property applies to the slrealtime.ui.control.RebootButton
component. The property selects whether to pause operation of the instrument panel while
the target computer completes the reboot process.
Example: 0
Data Types: logical
Record Button Component
This property applies to the slrealtime.ui.control.RecordButton
component. The property selects the icon that is displayed on the button.
Example: 'slrtStartRecordIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.RecordButton
component. The property selects the text that is displayed on the button.
Example: 'Start Recording'
Data Types: string
This property applies to the slrealtime.ui.control.RecordButton
component. The property selects the icon that is displayed on the button.
Example: 'slrtStopRecordIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.RecordButton
component. The property selects the text that is displayed on the button.
Example: 'Stop Recording'
Data Types: string
Start-Stop Button Component
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects whether the button stop action imports the file log from the real-time
application.
Example: 1
Data Types: logical
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects whether the button stop action exports the file log data to the model base
workspace from the real-time application.
Example: 1
Data Types: logical
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects whether the button stop action reloads the real-time application.
Example: 1
Data Types: logical
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects the icon that is displayed on the button.
Example: 'slrtRunIcon.png'
Data Types: string
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects the text that is displayed on the button.
Example: 'Start'
Data Types: string
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects the icon that is displayed on the button.
Example: 'slrtStopIcon.png'
Data Types: string
This property applies to the
slrealtime.ui.control.StartStopButton component. The property
selects the text that is displayed on the button.
Example: 'Stop'
Data Types: string
The callback code for the PreStartFcn function executes before
the StartStopButton component issues a start(tg)
command.
Example: disp('Starting MLDATX run on target
computer')
The callback code for the PostStartFcn function executes after
completion of the start(tg) command from the
StartStopButton component.
Example: disp('Started MLDATX run on target
computer')
The callback code for the PreStopFcn function executes before the
StartStopButton component issues a stop(tg)
command.
Example: disp('Stopping MLDATX run on target
computer')
The callback code for the PostStopFcn function executes after
completion of the stop(tg) command from the
StartStopButton component.
Example: disp(Stopped MLDATX run on target
computer')
System Log Component
This property applies to the slrealtime.ui.control.SystemLog
component. The property selects whether the log entries include timestamps.
Example: false
Data Types: logical
Target Computer Selection
When you select a target computer from the TargetSelector component, the component updates its
TargetName property and synchronizes the
TargetSource property of all instrument panel controls to the
current state of the selection. See the TargetSource
property.
Example: myTarget = h.TargetName
Data Types: string
When you select a target computer from the target computer selector component, all
instrument panel controls synchronize and update to the current state of the selection.
All Simulink®
Real-Time™ components (other than the TargetSelector component) have a TargetSource property
that has one of these values:
empty (default)
Empty is the default and tells the component to use the default SLRT target computer.
string
String is the name of an SLRT target computer.
slrealtime.ui.control.TargetSelectorslrealtime.ui.control.TargetSelectorenables a component to query the currently selected target and to be notified when the selection changes.
Example: ts =
slrealtime.ui.control.TargetSelector;
Example: h.TargetSource = ts;
Data Types: string | slrealtime.ui.control.TargetSelector
Update Button Component
This property applies to the slrealtime.ui.control.UpdateButton
component. The property selects the icon that is displayed on the button.
Example: 'slrtUpdateIcon.png'
Data Types: string
This property applies to the slrealtime.ui.control.UpdateButton
component. The property selects the text that is displayed on the button.
Example: 'Update Software'
Data Types: string
Version History
Introduced in R2021bThe Simulink
Real-Time
LatchButton
and MomentaryButton components provide push button support for App Designer apps
and App Generator generated apps.
To provide support for pre- and post-event callback code that executes when the state
changes for LatchButton
and MomentaryButton components, these Simulink
Real-Time App Designer components have added properties for adding callback code. For
property descriptions, see slrealtime.ui Properties. The event-related properties for the LatchButton
and MomentaryButton components include PreButtonDownFcn,
PostButtonDownFcn, PreButtonUpFcn, and
PostButtonUpFcn.
The Simulink
Real-Time
LatchButton
and MomentaryButton components provide push button support for App Designer apps
and App Generator generated apps.
Information is available for the slrealtime.instrument.LineStyle object Label property. In
the App Generator, for an Axes component, this property appears as
Line Label. In App Designer, the Label property
is set by using the slrealtime.instrument.LineStyle object.
To provide support for pre- and post-event callback code that executes when the state changes for a button component, several Simulink Real-Time App Designer components have added properties for adding callback code. In the App Generator, you can edit the code by using the Callback Editor. In the App Generator, select Options > Configure Components > component > Callbacks, provide a function name, and click the Add button. In App Designer, you can edit the code by using the Code View. For property descriptions, see slrealtime.ui Properties. The components and their event-related properties include:
ConnectButton:PreConnectFcn,PostConnectFcn,PreDisconnectFcn,PostDisconnectFcnImportFileLogButton:PreImportFcn,PostImportFcnLoadButton:PreLoadFcn,PostLoadFcnStartStopButton:PreStartFcn,PostStartFcn,PreStopFcn,PostStopFcn
The App Designer Simulink Real-Time components have an Enable
property. You can use this property to disable selected components when the app runs. For
more information, see the Enable
property. For graphical (non Simulink Real-Time) components that are configured with a
Simulink Real-Time ParameterTuner, you can use the Enable property on the
ParameterTuner to enable or disable the graphical component.
Added properties for these components:
Menucomponent — addedAsyncLoadproperty,AutoImportFileLogproperty,ExportToBaseWorkspaceproperty,ReloadOnStopproperty, andSkipInstallproperty.StartStopButtoncomponent — addedAutoImportFileLogproperty,ExportToBaseWorkspaceproperty, andReloadOnStopproperty.RebootButtoncomponent — addedWaitForRebootproperty.RecordButtoncomponent — addedStartRecordingIconproperty,StopRecordingIconproperty,StartRecordingTextproperty, andStopRecordingTextproperty.
See Also
ConnectButton | EventManager | InstrumentManager | LatchButton | LoadButton | Menu | MomentaryButton | ParameterTable | ParameterTuner | SignalTable | SimulationTimeEditField | StartStopButton | StatusBar | StopTimeEditField | SystemLog | TETMonitor | TargetSelector | UpdateButton
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Website auswählen
Wählen Sie eine Website aus, um übersetzte Inhalte (sofern verfügbar) sowie lokale Veranstaltungen und Angebote anzuzeigen. Auf der Grundlage Ihres Standorts empfehlen wir Ihnen die folgende Auswahl: .
Sie können auch eine Website aus der folgenden Liste auswählen:
So erhalten Sie die bestmögliche Leistung auf der Website
Wählen Sie für die bestmögliche Website-Leistung die Website für China (auf Chinesisch oder Englisch). Andere landesspezifische Websites von MathWorks sind für Besuche von Ihrem Standort aus nicht optimiert.
Amerika
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)