xPC Target    

xPC Target Code Generation Options

Below is a description of the fields in the xPC target code generation options page. To open this page, open the Simulation Parameters dialog box, chick the Real-Time Workshop tab, and then from the Category list, select xPC Target code generation options.

You may need to enter and select these options before you create (build) a target application. However, this is not normally necessary since the parameters have reasonable defaults.

Execution Mode -- From the list select either Real-Time or Freerun.

Log Task Execution Time -- Select this check box to log task execution times to the target object property tg.TETlog.

Signal Logging Buffer Size in Doubles -- Enter the maximum number of sample points to save before wrapping. Your target application uses this buffer to store the time, states, outputs, and task execution time logs as defined in your Simulink model.

For example, the model xpc_osc2.mdl has 6 data items (1 time, 2 states, 2 outputs, and 1 task execution time (TET)). If you enter a buffer size of 100000, then the target object property tg.MaxLogSamples is calculated as floor(100000) / 6) = 16666. After saving 16666 sample points, the buffer wraps and further samples overwrite the older ones.

If you select a logging buffer size larger then the available RAM on the target PC, after downloading and initializing the target application, the target PC displays a message, ERROR: allocation of logging memory failed. In this case you need to install more RAM or reduce the buffer size for logging. In any case the target PC has to be rebooted.

Real-Time Interrupt Source -- From the list select Timer or a number from 5 to 15.

I/O board generating the interrupt -- From the list, select None/Other, CB_CIO-CTR05, CB_PCI-CTR05, Softing_CAN-AC2-104, Softing_CAN-AC2-PCI, or RTD_DM6804.

PCI slot/ISA base address -- Enter the slot number or base address for the I/O board generating the interrupt. The PCI slot can be either -1 (let xPC Target determine the slot number) or of the form [bus, slot]. The base address is a hexadecimal number of the form 0x300.

To determine the bus and PCI slot number of the boards in the target PC, in the MATLAB Command Window, type getxpcpci.

xPC Target Code Generation Options (cont.) Page

Below is a description of the fields in the xPC Target code generation options (cont.) page. To open this page, open the Simulation Parameters dialog box, click the Real-Time Workshop tab, and then from the Category list, select xPC Target code generation options (cont.).

Double buffer parameter changes -- Selecting this option changes parameter tuning so that the process of changing parameters in the target application uses a double buffer.

This approach leads to a more robust parameter tuning interface, at the cost of increased TET and a higher probability of overloads. You should normally clear this check box. It is cleared by default.

Build signals & parameters COM objects using xPC Target Tags -- If you select this check box, the build process creates a model specific COM library file

Use this file to create custom GUI interfaces with Visual Basic or other tools that can use COM objects.

Name of xPC Target object created by build process -- Enter the name of the target object created by the build process. The default target object name is tg.

External Mode -- Select this check box to activate external mode for parameter tuning from your Simulink model. This check box is selected by default.

xPC Target does not currently support signal uploading using external mode. Instead of using a Simulink Scope block, use an xPC Target Scope block to trace signals.


  Increasing the Time Out Value Running the Target Application