主要内容

TargetSettings

Configure setting values for target computers

Since R2026a

Description

A TargetSettings object contains setting values that define a target computer.

Creation

targetsettings_object = slrealtime.TargetSettings() constructs a TargetSettings object that can contain the settings values to define a target computer. Use the a TargetSettings object to add a target computer definition to a Targets object.

Example: Create Targets Object, Add Target Computers, Set IP Address

Properties

expand all

Set the name property of the TargetSettings object before creating a Target object for the target computer that is defined by the TargetSettings object. After the Target object is created, its name property is read-only.

Set the address property of the TargetSettings object before creating a Target object for the target computer that is defined by the TargetSettings object. After the Target object is created, its address property is read-only.

This port number is required for Simulink Real-Time. Do not change this value.

This port number is required for Simulink Real-Time. Do not change this value.

The username is used for target computer access. Do not change this value..

For information about changing the userPassword property, see Change Password for Target Computer.

For information about using the root user password, see Change Password for Target Computer.

Examples

collapse all

Add target computer definition 'TargetPC5' to Targets object objTargets.

  1. Create a Targets object. This handle object contains the target computer definitions.

    objTargets = slrealtime.Targets()
  2. Create a TargetSettings object. This value object contains the value settings for a target computer definition. Set name and address values for this object.

    objTargetSettings = slrealtime.TargetSettings
    objTargetSettings.name = 'TargetPC5'
    objTargetSettings.address = '192.168.7.25'
  3. Add a target computer definition to the Targets object objTargets.

    addTarget(objTargets,objTargetSettings)
  4. Create a Target object tg5 from the named target computer definition in the Targets object objTargets.

    tg5 = slrealtime('TargetPC5')

For security, some installations require changing the default userPassword for the target computer. To customize the password, change both:

  • The userPassword in the TargetSettings

  • The password for the slrt user on the corresponding target computer

  1. Create Targets object my_tgs.

    % create Targets object
    my_tgs = slrealtime.Targets();
    
  2. Create a TargetSettings object and set properties for the object, including the name, address, and user password.

    % create TargetSettings object; set name and address properties
    objTargetSettings = slrealtime.TargetSettings;
    objTargetSettings.name = 'TargetPC3';
    objTargetSettings.address = '192.168.7.15';
    objTargetSettings.userPassword = 'HelloThere!'
  3. Add the TargetSettings object to the Targets object. Create the Target object tg3 with the defined name, address, and user password.

    % add target computer definition to Targets object
    addTarget(my_tgs,objTargetSettings);
    
    % assign target computers to target object
    tg3 = slrealtime('TargetPC3');
  4. To set the password on the target computer, open a PuTTY session to the target computer (log in as user root and password root) and use the passwd command to set the password for the slrt. For more information about using PuTTY, see Execute Target Computer Command-Line Commands Via Console or SSH.

    Use the passwd command in PuTTY session to change the target computer user password.

Version History

Introduced in R2026a