Configure Target Computer Settings by Using MATLAB Language
R2026bBecause TargetSettings objects are
immutable after they are created, you cannot change the Name or IP address of an
existing Target
object or target computer definition. Instead, set the TargetSettings before
creation of a Target
object.
For example, you can follow this process to add target computer definition
'TargetPC5' to Targets
object objTargets.
Create a Targets object. This handle object contains the target computer definitions.
objTargets = slrealtime.Targets()
Create a
TargetSettingsobject. 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'
Add a target computer definition to the Targets object
objTargets.addTarget(objTargets,objTargetSettings)
Create a
Targetobjecttg5from the named target computer definition in theTargetsobjectobjTargets.tg5 = slrealtime('TargetPC5')
For information about configuring the IP address on the target computer hardware by
using MATLAB language, see the setipaddr function.
See Also
Simulink
Real-Time Explorer | TargetSettings | addTarget | setipaddr