Main Content


Create target computer selector component for instrument panel UI



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


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.

Introduced in R2021b