| Contents | Index |
xPC Target Library for Diamond
The Diamond-MM-32-AT Frame Analog Input block is a frame-based one. A frame consists of a fixed number of samples (defined by the Number of scans per frame parameter) for each of a specified set of channels. A scan is a group of samples, one for each channel.
Normally, the system timer controls an xPC Target model at intervals specified by the block Sample Time parameter. In contrast, the Diamond-MM-32-AT Frame Analog Input block executes the model in which it occurs each time it converts a new frame of data. You control this rate with the parameter values Interval between scans and Number of scans per frame:
Rate = (Interval between scans) x (Number of scans per frame)
You control the frame size with the parameter values Number of channels and Number of scans per frame:
frameSize = (Number of channels) x (Number of scans per frame)
After the block assembles a frame of data, it generates an interrupt, which triggers the next iteration of the model.
Note, after you add this block to a model and are ready to configure the model, edit the xPC Target code generation options.
From the model, select Simulation > Configuration Parameters.
In the Target selection section, from the System target file list, browse to and select xpctarget.tlc.
In the xPC Target options node, from the I/O board generating the interrupt list, select the value Diamond-MM-32. This specifies that the Diamond-MM-32-AT board generates the interrupt.
In the same node, from the Real-time interrupt source list, select the IRQ number you have jumpered on the board.
In the same node, for the PCI slot (-1: autosearch) or ISA base address parameter, enter the same ISA address as for the Diamond-MM-32-AT Frame block Base address parameter.
Note To enable the interrupt for the frame-based block, the 16-bit bus jumper must be present in the board J7 jumper block. For further details, see the section labeled "16-Bit Bus" in the Diamond-MM-32-AT documentation (http://www.diamondsystems.com/files/binaries/DMM32v2.64.pdf). |
Hardware Input | Block Output Data Type | Scaling |
|---|---|---|
Volts | Double | 1 |
From the list, select the following. Refer to the Diamond-MM-32-AT documentation for a description of the configuration modes.
1-32 Single-Ended to select the configuration mode labeled A (32 single-ended input channels)
1-16 Differential to select the configuration mode labeled B (16 differential input channels)
1-8 and 7-24 Single-Ended; 9-16 Differential to select the configuration mode labeled D (eight single-ended input channels labeled 1 through 8, eight differential input channels labeled 9 through 16, and an additional eight single-ended input channels labeled 17 through 24).
Note that the selected channel configuration must match the configuration set by the jumpers in block J5. This driver does not support mode C.
From the list, select either Vector or Frame:
Vector — Select Vector if you expect the output signal from this block to be the input signal for an xPC Target scope or some other block that requires vector input.
Frame — Select Frame if you expect the output signal from this block to be the input signal for a block that requires a frame. For example, a Signal Processing block.
From the list, select a voltage range. The input range applies to all channels.
Enter the number of the first channel in a set of contiguous channels. Depending on the value of the Channel Configuration parameter, the first channel number must be within the range 1 through 32, 1 through 16, or 1 through 24.
Number the channels starting from 1 even if Diamond Systems numbers them starting from 0.
Enter the number of input channels you want to use. The maximum number of channels varies between 1 and 32 and depends on Channel configuration and the First channel number. Note that hardware limitations require that either the Number of channels or Number of scans per frame value be even. If your application requires that both quantities be odd, add 1 to one of them and ignore the resulting additional data.
Enter the number of scans per frame. For a value of N, each output port of the block will have a signal width of N and contain N samples of the corresponding channel. Note that hardware limitations require that either the Number of channels or Number of scans per frame value be even. If your application requires that both quantities be odd, add 1 to one of them and ignore the resulting additional data.
From the list, select the interval, in microseconds, between conversions within a scan.
Enter the interval, in seconds, between successive scans.
Enter the base address of the board. This entry must correspond to the DIP switch settings on the board. For example, if the base address is 300 (hexadecimal), enter
0x300

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |