function rtobj_connect % Create a new real-time host environment collection object rthosts = simwb.rthosts % Get names of real-time host environments present in the collection rthosts.getRTEnvNames % Create a new real-time host object and link it to the RedHawk1 % environment rtobj1 = simwb.rtobj('RedHawk1') % While creating the real-time host object, the object will try to % establish a connection between MATLAB and the Simulation Workbench server % running on the real-time host. You can also establish a connection using % the connect method rtobj1.connect % Dispaly rtobj1 object rtobj1
rthosts =
simwb handle
Properties:
NumHosts: 3
ans =
'RedHawk1'
'RedHawk2'
'RedHawk3'
rtobj1 =
simwb.rtobj handle
Package: simwb
Properties:
RTHostName: 'RedHawk1'
Connected: 1
RTWStruct: [1x1 struct]
rtobj1 =
simwb.rtobj handle
Package: simwb
Properties:
RTHostName: 'RedHawk1'
Connected: 1
RTWStruct: [1x1 struct]