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

Table of Contents

Advertisement

// If bufferType != NULL, bufferType will be set.
// Returns a buffer with the analog data read in if successful
// the client will be responisble for freeing the buffer.
float* ReadAnalogWaveform(FILE* inputFile,
{
tPBWaveformDataHeader dataHeader;
float* pWaveformData = NULL;
if (ReadWaveformDataHeader(inputFile, &dataHeader) && waveformHeader)
{
// Make sure everything is the expected format
int actualNumberOfPoints;
int validDataType;
actualNumberOfPoints = dataHeader.BufferSize / dataHeader.BytesPerPoint;
validDataType = (dataHeader.BufferType == PB_DATA_NORMAL) ||
if (bufferType != NULL)
{
*bufferType = dataHeader.BufferType;
}
if ((dataHeader.BytesPerPoint == 4) && validDataType &&
(actualNumberOfPoints == waveformHeader->Points))
{
// Now let's read in the data
pWaveformData =(float*) malloc(dataHeader.BufferSize);
if (pWaveformData)
{
fread(pWaveformData, 1, dataHeader.BufferSize, inputFile);
}
}
if (pWaveformData == NULL)
{
// ignore dataHeader.BufferSize because we either
// did not allocate WaveformData or we do not
// recognize the data format
fseek(inputFile, dataHeader.BufferSize, SEEK_CUR);
if (bufferType != NULL)
{
*bufferType = PB_DATA_UNKNOWN;
}
}
}
return pWaveformData;
}
Disk Commands
BIN Header Format
const tPBWaveformHeader* waveformHeader,
ePBDataType* bufferType)
(dataHeader.BufferType == PB_DATA_MIN) ||
(dataHeader.BufferType == PB_DATA_MAX);
13-32

Advertisement

Table of Contents
loading

Table of Contents