Exporting and Importing xPC Target Explorer Environments

www.kxcad.net Home > CAE Software Index > MATLAB Index >



The xPC Target Explorer environment consists of the property settings you define for the Configuration node, for example, for the host communication method and so forth. When you have settings that you are happy with, you can save them as variables in the MATLAB workspace.

This topic describes how to export target PC node property settings in a structured format to the MATLAB workspace. It assumes that you have set environment settings with xPC Target Explorer. See Environment Properties for Serial Communication or Environment Properties for Network Communication.

  1. If the xPC Target Explorer is not open, open it now. At the MATLAB Command Window, type

    xpcexplr
  2. In the xPC Target Explorer xPC Target Hierarchy pane, right-click the Configuration node of the target PC for which you want to save the configuration. For example, right-click TargetPC1.

    A context-sensitive menu is displayed.

  3. Select Export Environment.

    The Export Environment to Workspace dialog is displayed.

  4. In the Export Environment to Workspace dialog box, enter a unique name. For example, type TargetPC1env.

  5. Add configuration variables for as many target PC configurations as you need.

    The following illustrates a MATLAB workspace with two xPC Target Explorer environment configuration variables.

You can save the target PC environment structure to a MAT-file. This enables you to reimport the configuration defined in the structure into a future xPC Target Explorer session.

  1. To save the variable TargetPC1env in the MAT-file targetpc1.mat, in the MATLAB Command Window, type

    save targetpc1.mat TargetPC1env

    MATLAB saves the file targetpc1.mat in the current directory.

  2. In the same MATLAB session, or in a different one, load the contents of targetpc1.mat into the MATLAB workspace. Type

    load targetpc1.mat
  3. If the xPC Target Explorer is not open, open it now.

  4. In the xPC Target Explorer xPC Target Hierarchy pane, right-click the target PC node for which you want to import the configuration. For example, right-click TargetPC1.

    A context-sensitive menu is displayed.

  5. Select Import Environment.

  6. In the Import Environment Structure dialog, select a previously exported configuration. For example, select TargetPC1env.

  


© 1984-2007 The MathWorks, Inc. Terms of Use Patents Trademarks Acknowledgments