User manual
Programmer’s Guide    Page 45 of 66 
3.11.8.4. Reading the histogram 
The  accumulated  histogram  can  be  read  out  using  readMode  =  9  (ReadModeHistogram).  The  dataType  and 
dataArraySize must be selected to correspond to the size of the histogram and its bins. 
The waveform descriptor structure contains the value actualDataSize giving the total number of data bytes read. The 
individual  histogram  bins  will  be  able  to  contain  accumulated  sums  of  either  2**32,  as  ViUInt32,  or  2**16,  as 
ViUInt16. 
Histogram bin is 32 bits wide 
31..0 
Bin0 
… 
Histogram bin is 16 bits wide 
31..16 
15..0 
Bin 1 
Bin 0 
… 
… 
3.11.9. Reading U1084A Peak
TDC
 Waveforms and Histograms 
3.11.9.1. Reading the histogram 
Use „readMode‟ = 9 (ReadModeHistogram), „dataType‟ = 2 (ReadInt32) to read out the accumulated histogram. The 
nbrSamples must be  selected to correspond to  the size  of the histogram  and its bins. Note  that the value for 
„nbrSamples‟  should  correspond  to the  number  of  bins in  the  histogram  to read,  which  may  be different  from the 
configured number of samples in the acquisition  if interpolation is enabled. For example, if you  have configured 
„NbrSamples’ to  1024  and  „TdcHistogramHorzRes’ to 3 with AcqrsD1_configAvgConfig, there will be 2
3
 = 8 
bins per sample, for a total of 1024 * 2
3
 = 8192 bins available for readout. 
If vertical interpolation is used, the values of the bins should be interpreted as fixed point fractional values. This 
means that, if „TdcHistogramVertRes’ is set to N, the actual amplitude of the bin is the raw unsigned integer value 
divided by 2
N
. 
Because  the data array  and transfer  size  may  have to be  realigned,  the data array  should  be  at least  16  bytes  (4 
samples) longer than the histogram data to read. To find the first valid sample in the data array, the data descriptor‟s 
„indexFirstPoint‟ field must be used, which indicates the offset in samples of the first  valid sample from  the 
beginning of the data array. 
3.11.9.2. Reading the last acquired waveform 
To  facilitate  the visualization  and  interpretation  of the  histogram  data,  the  U1084A  permits  to  read  the  last  raw 
waveform which contributed to the histogram, as 8 bit samples. This is done using readMode = 0 (ReadModeStdW) 
with  dataType =  0 (ReadInt8). The  procedure is  the same  as the  one described in 3.11.1 Reading   Digitizer 
Waveforms with the Universal Read Function. 
3.11.10.  Reading AP101/AP201 Analyzer Waveforms 
3.11.10.1.  Reading a Buffered Waveform Sequence 
This section concerns AP101/AP201 Analyzers ONLY. In normal mode, you may read the acquired waveform(s) in 
the same  way as  with any  other digitizer,  as  described  in the  section  3.11,  D1-style Data  Readout,  in the 
Programmer‟s Guide. 
In buffered mode, you must use the functions AcqrsD1_readData to read out the accumulated waveform sequence, 
as a single data  record.  E.g. if  you configured  nbrSamples  =  5000  and  nbrSegments  =  800,  you  should  specify 
segmentNumber = 0 and nbrSamples = 4‟000‟000. 
Before reading the buffered data, you must switch to the other memory bank. Typically, you also would start a new 
acquisition before readout, but it is not required. This is done automatically in the SSR mode as a consequence of the 
call to AcqrsD1_processData with a non-zero flag value. It can also be done with a call to AcqrsD1_configMode 
The  read-function  returns  zero  into  the  dataDesc  variables  horPos,  tStampLo  and  tStampHi,  since  they  are 
unavailable in the context of a buffered waveform sequence. 










