Documentation

Diamond MM-32-AT Frame Analog Input (A/D)

MM-32-AT Frame Analog Input block

Library

Simulink® Real-Time™ Library for Diamond

Note

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 a Simulink Real-Time 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 Simulink Real-Time code generation options.

  1. From the model, select Simulation > Model Configuration Parameters.

  2. Select the Code Generation node.

  3. In the Target selection section, from the System target file list, browse to and select slrt.tlc.

  4. In the Simulink Real-Time 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.

  5. In the same node, from the Real-time interrupt source list, select the IRQ number you have jumpered on the board.

  6. 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.

  7. Click OK and save the model.

    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 (www.diamondsystems.com).

Scaling Input to Output

I/O Module Input

Block Output Data Type

Scaling

Volts

Double

1

Block Parameters

Channel configuration

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.

Output Signal Type

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 a Simulink Real-Time 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.

Range

From the list, select a voltage range. The input range applies to all channels.

First channel number

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.

Number of channels

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 First channel number. Note that physical limitations require that either the Number of channels or Number of scans per frame value be even. If your model requires that both quantities be odd, add 1 to one of them and ignore the resulting additional data.

Number of scans per frame

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 physical limitations require that either the Number of channels or Number of scans per frame value be even. If your model requires that both quantities be odd, add 1 to one of them and ignore the resulting additional data.

Interval between conversions within a scan

From the list, select the interval, in microseconds, between conversions within a scan.

Interval between scans

Enter the interval, in seconds, between successive scans.

Base address

Enter the base address of the board. This entry must correspond to the DIP switch setting on the board. For example, if the DIP switch setting is 300 (hexadecimal), enter 0x300.

External Websites

Was this topic helpful?