Technical data
Waveform Commands 32
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference 883
fp = fopen( "pairs.csv", "wb" ); /* Open file in binary mode - clear
file if it already exists */
if (fp != NULL)
{
while( !done )
{
BytesRead = ReadWord( buffer, &reason, BytesToRead );
switch( reason )
{
case I_TERM_MAXCNT:
done = FALSE;
break;
case I_TERM_END:
done = TRUE;
break;
case I_TERM_CHR:
done = TRUE;
break;
default:
done = TRUE;
break;
};
buff = (short *) buffer;
for(i=0;i<((BytesRead - 1)/2); i++)
{
Time = (j * xInc) + xOrg; /* calculate time */
j=j+1;
Volts = (buff[i] * yInc) + yOrg;/* calculate voltage */
fprintf( fp, "%e,%f\n", Time, Volts );
}
}
fclose( fp );
}
else
{
printf("Unable to open file 'pairs.csv'\n");
}
}
Understanding
WORD and BYTE
Formats
Before you can understand how the WORD and BYTE downloads work, it
is necessary to understand how Infiniium creates waveform data.
Analog-to-digital
Conversion
Basics
The input channel of every digital sampling oscilloscope contains an
analog- to- digital converter (ADC) as shown in Figure 8. The 8- bit ADC in
Infiniium consists of 256 voltage comparators. Each comparator has two
inputs. One input is connected to a reference dc voltage level and the
other input is connected to the channel input. When the voltage of the
waveform on the channel input is greater than the dc level, then the