Instruction manual

AMPDIO DRIVERS
Page 48
, PULONG pBuffer
);
The wParam parameter is the user parameter specified in the interrupt set-up function call. It can
be any user value, a pointer to a user’s data structure, a user code etc. The sizeofBuffer parameter
is the length of the buffer being passed to the function. This is generally the buffer length passed to
the interrupt set-up function. It is possible for sizeofBuffer to be 0 if an error has occurred. The
pBuffer parameter points to the buffer in memory. In Delphi, it may be treated as a pointer to an
array. See section 6.4.14.4 for a detailed description of the callback function.
If the buffer contains data for multiple analogue channels, it may be useful to treat the buffer
pointed to by the pBuffer parameter as a 2-dimensional array with the size of the inner dimension
being the number of channels selected by the ChanMask parameter passed to the
TCsetBufferUserInterruptAIO interrupt set-up function. The buffer size specified should be a
multiple of the number of selected channels so that the data in each buffer starts on the same
channel.
For example, if the ChanMask is set to 5 (101
2
), then two channels (0 and 2) are selected. If the
buffer is treated as a 1-dimensional array (starting at index 0) then:
 Array element [0] is the first data element for channel 0.
 Array element [1] is the first data element for channel 2.
 Array element [2] is the second data element for channel 0.
 Array element [3] is the second data element for channel 2.
If the above buffer is treated as a 2-dimensional array with an inner dimension of size 2 (starting at
index 0, 0), then:
 Array element [0][0] is the first data element for channel 0.
 Array element [0][1] is the first data element for channel 2.
 Array element [1][0] is the second data element for channel 0.
 Array element [1][1] is the second data element for channel 2.
The above assume that the buffer size is a multiple of 2. Array syntax varies with language The
above is based on the ‘C’ language.
The same construct may be used for the other interrupt data transfer types that yield or consume
more than one 32-bit data value on each interrupt, such as ISR_READ_2PPIABC and
ISR_WRITE_2PPIABC.
3.4.3.2.1 Acquiring AC Analogue Signals
By using this mechanism, the user can acquire AC analogue signals. In the “SCOPE” example, the
user function instructs the driver to acquire two channels of analogue data into a buffer. This buffer
is then formatted on a graph resembling an oscilloscope. It is possible to sample at a total rate of
312500 samples per second for short periods on the original PCI230 and PCI260 cards. For the
new PCI230+ and PCI260+ cards, the total maximum rate is reduced to 250000 samples per
second. This is the maximum total sample rate for all channels combined. The sample rate for the
PCI230 and PCI260 cards is independent of machine performance, however this is not true of the
supported ISA cards.
3.4.3.2.1.1 Controlling Timing for Reading Multiple Analogue Channels
When reading multiple analogue channels, the channels are read sequentially, but only one
channel is read per conversion trigger. If a rate generator is set up on a timer/counter channel
acting as a conversion trigger, then to sample N channels at a frequency f, the rate generator can
be set to generate a frequency of (N × f). This will result in the channels being read interleaved