MATLAB: Am I unable to connect two Simulink models in external mode running on a single host to two different xPC target machines

multipleSimulink Real-Timetargets

I have two different Simulink models on my host machine. The models always get downloaded to the default xPC Target. I have to disconnect a model from the default xPC Target, set the other target as my default and then download the second model to the second xPC Target machine. Thus I am unable to run the two Simulink models in external mode on two different xPC Target machines.

Best Answer

In order to download the Simulink model to another target and not the default target, specify the "target PC name" parameter in the xPC Target Configuration parameters for each of the models. This parameter directs both the download from build process and external mode to communicate to the specified Target PC Name.
In order to set the above option, please perform the following steps:
1. Open the Simulink model that you want to send to a particular target
2. Open the model Configuration Parameters box by selecting Simulation -> Configuration Parameters…
3. In the left pane, under "Real-Time Workshop" select "xPC Target options"
4. In the right pane, uncheck the option "Download to default target PC"
5. This should display a "Specify target PC name" textbox where you can enter the Target PC name
If two different xPC Targets are selected for the two different Simulink models, there should not be any issues in downloading and controlling two different xPC Targets from one host.