Main Content

TargetSelector

Create target computer selector component for instrument panel UI

Description

example

hTargetSelector = slrealtime.ui.control.TargetSelector(hFigure) creates a target computer selector component for an instrument panel uifigure figure. Simulink® Real-Time™ refers to target computers by mapping unique names to IP addresses. Multiple mappings are allowed.

You can access each target computer by using its name. One mapping is the default and is used when no target computer name is supplied. The target selector component displays the list of all named target computers currently defined on the development computer.

The target computer selector list entry Simulink Normal Mode is not a customer-defined target. This selection appears at the end of the list to support Simulink normal mode simulation of a model. When you select Simulink Normal Mode in the target selector, the load application button changes to a load model button. Use this button to select the model to interface with the control panel app.

The drop-down list is editable. You can enter a valid IP address and create a temporary target computer mapping that is removed when the target computer selector component is destroyed.

It is possible to have different components in the same instrument panel synchronize with different target computers. By selecting a target computer for a component by using the TargetSelector, instrument panel components with their TargetSource property set to the TargetSelector synchronize and are updated to the current state of the target computer selected by the TargetSelector. For more information, see the TargetSource property description in slrealtime.ui Properties.

Examples

collapse all

Create a target selector component and adjust the position of the component.

% Create figure 
hFig = uifigure();
% Create target selector component  
hTgSelect = slrealtime.ui.control.TargetSelector(hFig);
% Change position of the component 
hTgSelect.Position = [100 100 200 30];

Input Arguments

collapse all

The hFigure argument identifies the uifigure to which you are adding the UI component.

Example: hFig = uifigure()

Data Types: function_handle

Output Arguments

collapse all

The hTargetSelector argument is the handle to the target selector component that you create.

Version History

Introduced in R2021b