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

Table of Contents

Advertisement

int main(int argc, char** argv)
{
FILE* inputFile;
if (argc < 2)
{
printf("binToAscii <input file> <output file 1> ... <output file n>\n");
return 0;
}
inputFile = fopen(argv[1], "rb");
if (inputFile)
{
tPBFileHeader fileHeader;
fread((char*) &fileHeader, 1, sizeof(fileHeader), inputFile);
// verify cookie
if (fileHeader.Cookie[0] == PB_COOKIE[0] &&
fileHeader.Cookie[1] == PB_COOKIE[1])
{
int w;
if ((argc - 2) < fileHeader.NumberOfWaveforms)
{
// Not enough output files were provided
// Use stdout to summarize input file
printf("Infiniium Public Waveform File version %c.%c\n",
for (w = 0; w < fileHeader.NumberOfWaveforms; ++w)
{
SummarizeWaveform(inputFile, stdout);
}
}
else
{
for (w = 0; w < fileHeader.NumberOfWaveforms; ++w)
{
FILE* outputFile = fopen(argv[w + 2], "w");
if (outputFile)
{
}
else
{
}
}
}
}
else
fileHeader.Version[0],
fileHeader.Version[1]);
OutputWaveform(inputFile, outputFile);
fclose(outputFile);
printf("Unable to open %s\n", argv[w + 2]);
Disk Commands
BIN Header Format
13-41

Advertisement

Table of Contents
loading

Table of Contents