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

Table of Contents

Advertisement

/*
*
Function name:
*
Parameters:
none
*
Return value:
*
Description:
This routine performs automatic measurements of volts
*
peak-to-peak and frequency on the acquired data. It also demonstrates
*
two methods of error detection when using automatic measurements.
*/
void auto_measurements( void )
{
float frequency, vpp;
unsigned char vpp_str[16];
unsigned char freq_str[16];
int bytes_read;
/*
* Error checking on automatic measurements can be done using one of two methods.
*
The first method requires that you turn on results in the Measurements
* subsystem using the command :MEASure:SEND ON. When this is on, the oscilloscope
*
will return the measurement and a result indicator.
*
if the measurement was successfully completed, otherwise a non-zero value is
*
returned which indicates why the measurement failed.
*
*
The second method simply requires that you check the return value of the
*
measurement. Any measurement not made successfully will return with the value
*
+9.999E37. This could indicate that either the measurement was unable to be
*
performed, or that insufficient waveform data was available to make the
*
measurement.
*/
/*
*
METHOD ONE - turn on results to indicate whether the measurement completed
*
successfully.
*
oscilloscope.
*/
write_IO(":MEASure:SENDvalid ON");
/* query volts peak-to-peak channel 1 */
write_IO(":MEASure:VPP? CHANnel1");
bytes_read = read_IO(vpp_str,16L);
if (vpp_str[bytes_read-2] != '0')
printf("Automated vpp measurement error with result %c\n",
vpp_str[bytes_read-2]);
else
printf("VPP is %f\n",(float)atof(vpp_str));
Sample Programs
Sample C Programs
init.c - Making Automatic Measurements
auto_measurements
none
Note that this requires transmission of extra data from the
6-8
The result flag is zero
/* turn results on */
/* read in value and result flag */

Advertisement

Table of Contents
loading

Table of Contents