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

Table of Contents

Advertisement

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

Advertisement

Table of Contents
loading

Table of Contents