xPC Target    

Defining I/O Block Parameters

The I/O block parameters define values for your physical I/O boards. For example, I/O block parameters include channel numbers for multichannel boards, input and output voltage ranges, and sample time.

This procedure uses the Simulink model xpcosc.mdl as an example, and assumes you have added an analog input and an analog output block to your model. To add an I/O block, see either Adding I/O Blocks with the xPC Target Library orAdding I/O Blocks with the Simulink Library Browser.

  1. In the Simulink window, double-click the input block labeled Analog Input.

    The dialog box for the A/D converter opens.

  1. Fill in the dialog box. For example, for a single channel enter 1 in the Number of Channels box, choose ±10 V for the input range, and choose single-ended (16 channels)for the MUX-switch position. Enter the same sample time you entered for the step size in the Simulation Parameters dialog box. Enter the base address for this ISA-bus board.

    The Block Parameters dialog box should look similar to the figure shown below.

  1. In the Simulink window, double-click the output block labeled Analog Output.

    The dialog box for the D/A converter opens.

  1. Fill in the dialog box. For example, for one channel enter [1] in the Channel Vector box, for an ouptut level of ±10 V enter the code [-10] in the Range Vector box. Enter the same sample time you entered for the step size in the Simulation Parameters dialog box. Enter the base address for this ISA-bus board.

    The Block Parameters dialog box should look similar to the figure shown below.

If you change the sample time by changing the target object property SampleTime, the step size you entered in the Simulation Parameters dialog box, as well as the sample times you entered in both of the I/O blocks are set to the new value.

Your next task is to build and run the target application, see Creating the Target Application.


 Adding I/O Blocks with the Simulink Library Browser xPC Target Scope Blocks