Products & Services Solutions Academia Support User Community Company

Learn more about xPC Target   

User Interaction

Introduction

The xPC Target environment has a modifiable interface to the target PC. You can use this interface from MATLAB or Simulink, and you can use other development environments to create stand-alone client applications independent of MATLAB. Because of this open environment, there are several ways to interact with your target application from the host and target PCs.

The following table compares the interfaces supported by the xPC Target product.

Interface

Environment Properties

Control

Signal Acquisition

Parameter Tuning

xPC Target Explorer

X

X

X

X

MATLAB Command-Line Interface

X

X

X

X

Simulink External Mode Interface

 

X

 

X

Simulink with xPC Target Scope Blocks

  

X

 

Target PC Command-Line Interface

 

X

X

X

Web Browser Interface

 

X

X

X

Custom GUI with xPC Target API

 

X

X

X

Custom GUI with xPC Target COM API

 

X

X

X

xPC Target Explorer

The xPC Target software offers a graphical user interface (GUI) for configuring the host and target PCs and interacting with a target application. To open the xPC Target GUI, in the MATLAB Command Window, type xpcexplr.

The xPC Target Explorer is an all-in-one user interface that includes the following functionality.

For more information, see Signals and Parameters in the xPC Target User's Guide.

MATLAB Command-Line Interface

You can interact with the xPC Target environment through the MATLAB command-line interface. Enter xPC Target functions in the MATLAB window on the host PC. You can also write your own M-file scripts that use xPC Target functions for batch processing.

The xPC Target software has more than 90 MATLAB functions for controlling the target application from the host computer. These functions define, at the most basic level, what you can do with the xPC Target environment.

The GUIs provided with the xPC Target product are for completing the most common tasks. They use the xPC Target functions but do not extend their functionality. The command-line interface provides an interactive environment that you can extend.

The MATLAB command-line interface includes the following functions:

Simulink External Mode Interface

Use Simulink in external mode to connect your Simulink block diagram to your target application. The block diagram becomes a graphical user interface to the target application running in real time. By changing parameters in the Simulink blocks, you also change parameters in the target application.

The Simulink external mode interface includes the following functions:

For more information, see Parameter Tuning with Simulink External Mode in the xPC Target User's Guide.

Simulink with xPC Target Scope Blocks

An alternative to interactively adding scopes to the target PC is to add xPC Target Scope blocks to your Simulink model. After the download process, these blocks create scopes on the target PC during initialization of the target application. You can choose to display data on either the host PC or target PC. You can also choose to save signal data (log real-time data stream) to a file in the target PC file system and transfer that file to another PC.

Signal acquisition — Add scopes to the target PC by adding xPC Target Scope blocks to your Simulink model. In the Block Parameters dialog box, select the scope mode and set the trigger.

For information on acquiring signal data with the xPC Target product, see Adding an xPC Target Scope Block, Entering Parameters for an xPC Target Scope Block, Entering Parameters for an xPC Target Scope of Type File, and Signal Tracing with xPC Target Scope Blocks in the xPC Target User's Guide.

Target PC Command-Line Interface

You can interact with the xPC Target environment through the target PC command window. Enter commands in the command line on the target PC. This interface is useful with stand-alone applications that are not connected to the host PC.

The target PC command-line interface includes the following functions:

Web Browser Interface

If the target PC is connected to a network (TCP/IP), you can use a Web browser to interact with the target application from any computer connected to the network. If the target PC is connected to the host PC with an RS-232 cable, and is using the TCP/IP to RS-232 gateway, you can use a Web browser on the host PC.

The Web browser interface includes the following functions:

Custom GUI with xPC Target API

Create a GUI application interface to a target application using any development environment that can link in a DLL.

Use the GUI application to control the application, tune parameters, and acquire signal data from a target application. The custom GUI runs on the host PC and communicates with the target application on the target PC using RS-232 or TCP/IP communication. A GUI application can be a console or Windows application using ActiveX® components.

For more information, see the xPC Target API Guide.

Custom GUI with xPC Target COM API

Create a GUI application that interfaces with a target application using Visual Basic® or any development environment that can incorporate COM objects. These COM objects connect graphic elements to parameters for parameter tuning, and they connect signals for acquiring data from your target application. To create a custom GUI application connected to an xPC Target application, use the following process:

  1. Create a Simulink model.

  2. Optionally, tag parameters and signals in the Simulink model.

  3. Build the target application.

  4. If you tag parameters and signals, build the model-specific COM library.

  5. Create a GUI application that references the COM library.

For more information, see the xPC Target API Guide.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS