There are two memory buffers in the card for storage of input digitalised signal
of two channels and for freeform signals synthesis. They are ADC and DAC memory
accordingly. In the ADC memory (its volume is 256 double words or 256Ê x 16 per
channel), there are digitalised signals of the two input channels. In the DAC
memory ( its volume is 256Ê words (256Ê x 16)), there is a digital presenting
of the synthesised signal. After starting the sampling process the card
goes to the mode in which DAC generates the synthesised presenting from the DAC
memory ( if DAC is ON see the functions XdspDACEnable, XdspDACDisable) with
simultaneous digitalising of the signal of two channels and data writing to the
ADC memory.During the sampling process the card executes generation of the
signal from the whole memory buffer of the DAC and fulling the whole ADC memory
buffer (dimensions of the buffers are the same).
ADC has 12 double bits, DAC has 7...14 double bits (it depends on the model).
Each cell of the ADC memory (double word) stores the value of the
digitalised signal of the 1st channel (12bit) in the smaller word and the
value of the digitalised signal of the 2nd channel (12bit) in the bigger word in
appropriate time. So in the double word (32 bit, 0..31) of the ADC memory,
there is a value of the digitalised signal of the 1st channel written in bits 0..15
in an extra code. The value of the digitalised signal of the 2nd channel in an
extra code is written in bits 16..31. Values for DAC memory are written to the
smaller 16 bit (0..15) of the double word in an extra code.
For separating the values of the digitalised signal (double word) from the ADC
memory to the channels and for making them of standard type SmallInt äëÿ Delphi
(int for Ñ\Ñ++, 2 byte number ) you may use the following example (for Delphi):
Const
ADCBufLen=262143;// Full volume of the ADC buffer, 256Ê of double words
Var
dwData : DWord;
i : Integer;
dma_buffer : PDmaMemoryBuffer;
signal_ch1 : Array[0..ADCBufLen] Of SmallInt; // Buffer for digitalised signal of the 1st channel
signal_ch2 : Array[0..ADCBufLen] Of SmallInt; // Buffer for digitalised signal of the 2nd channel
// Data devision from dma_buffer to two channels signal_ch1, signal_ch2
For i:=0 To ADCBufLen Do Begin
dwData:=dma_buffer^[i+1]; // DMA buffer block begins with index1
signal_ch1[i]:=dwData;
dwData:=dwData shr 16;
signal_ch2[i]:=dwData;
End;
|