Agilent Technologies Infiniium 8000A Programmer's Reference Manual page 287

Table of Contents

Advertisement

// Returns a buffer with the histogram counts data read in if successful
// the client will be responisble for freeing the buffer
int* ReadHistogramWaveform(FILE* inputFile,
{
int* pHistogramData = NULL;
tPBWaveformDataHeader dataHeader;
if (ReadWaveformDataHeader(inputFile, &dataHeader) && waveformHeader)
{
// Make sure everything is the expected format
int actualNumberOfPoints;
actualNumberOfPoints = dataHeader.BufferSize / dataHeader.BytesPerPoint;
if ((dataHeader.BytesPerPoint == 4) &&
(dataHeader.BufferType == PB_DATA_COUNTS) &&
(actualNumberOfPoints == waveformHeader->Points))
{
// Now let's read in the histogram count data
int* pHistogramData =(int*) malloc(dataHeader.BufferSize);
if (pHistogramData)
{
fread(pHistogramData, 1, dataHeader.BufferSize, inputFile);
}
}
if (pHistogramData == NULL)
{
// ignore dataHeader.BufferSize because we either
// did not allocate pHistogramData or we do not
// recognize the data format
fseek(inputFile, dataHeader.BufferSize, SEEK_CUR);
}
}
return pHistogramData;
}
const tPBWaveformHeader* waveformHeader)
Disk Commands
BIN Header Format
13-33

Advertisement

Table of Contents
loading

Table of Contents