Configure Target Computer Settings by Using MATLAB Language
Because 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')
When you use Simulink Real-Time Explorer to create target computer definitions, the tool performs these operations for you.