function rthostenv_multihost

% Create a new real-time host environment collection object
rthosts = simwb.rthosts
% Create a new real-time host environment object
rthostenv1 = simwb.rthostenv
% Customize the real-time host environment by changing the name and IP
rthostenv1.Name = 'RedHawk1'
rthostenv1.RTHostNameorIP = '192.168.0.10'
% Create a new real-time host environment object
rthostenv2 = simwb.rthostenv
% Customize the real-time host environment by changing the name and IP
rthostenv2.Name = 'RedHawk2'
rthostenv2.RTHostNameorIP = '192.168.0.11'
% Create a new real-time host environment object
rthostenv3 = simwb.rthostenv
% Customize the real-time host environment by changing the name and IP
rthostenv3.Name = 'RedHawk3'
rthostenv3.RTHostNameorIP = '192.168.0.12'
% Add these custom real-time host environments to the collection
rthosts.add(rthostenv1)
rthosts.add(rthostenv2)
rthosts.add(rthostenv3)
% Get names of real-time host environments present in the collection
rthosts.getRTEnvNames
rthosts = 

  simwb handle

  Properties:
    NumHosts: 1



rthostenv1 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'DefaultName'
    RTHostNameorIP: '127.0.0.1'



rthostenv1 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk1'
    RTHostNameorIP: '127.0.0.1'



rthostenv1 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk1'
    RTHostNameorIP: '192.168.0.10'



rthostenv2 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'DefaultName'
    RTHostNameorIP: '127.0.0.1'



rthostenv2 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk2'
    RTHostNameorIP: '127.0.0.1'



rthostenv2 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk2'
    RTHostNameorIP: '192.168.0.11'



rthostenv3 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'DefaultName'
    RTHostNameorIP: '127.0.0.1'



rthostenv3 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk3'
    RTHostNameorIP: '127.0.0.1'



rthostenv3 = 

  simwb.rthostenv handle
  Package: simwb

  Properties:
         Name: 'RedHawk3'
    RTHostNameorIP: '192.168.0.12'


	Real-time host environment with name RedHawk1 already exists
	Adding real-time host environment with name SimWB_RTHost1

ans = 

  simwb handle

  Properties:
    NumHosts: 2



ans = 

  simwb handle

  Properties:
    NumHosts: 3



ans = 

  simwb handle

  Properties:
    NumHosts: 4



ans = 

    'RedHawk1'
    'RedHawk2'
    'RedHawk3'
    'SimWB_RTHost1'