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

Table of Contents

Advertisement

write_IO(":MEASure:FREQuency? CHANnel1");
bytes_read = read_IO(freq_str,16L);
if (freq_str[bytes_read-2] != '0')
printf("Automated frequency measurement error with result %c\n",
freq_str[bytes_read-2]);
else
printf("Frequency is %f\n",(float)atof(freq_str));
/*
*
METHOD TWO - perform automated measurements and error checking with
*
:MEAS:RESULTS OFF
*/
frequency =(float)0;
vpp = (float)0;
/* turn off results */
write_IO(":MEASure:SENDvalid OFF");
write_IO(":MEASure:FREQuency? CHANnel1");
bytes_read = read_IO(freq_str,16L);
frequency = (float) atof(freq_str);
if ( frequency > 9.99e37 )
printf("\nFrequency could not be measured.\n");
else
printf("\nThe frequency of channel 1 is %f Hz.\n", frequency );
write_IO(":MEASure:VPP? CHANnel1");
bytes_read = read_IO( vpp_str,16L );
vpp = (float) atof(vpp_str);
if ( vpp > 9.99e37 )
printf("Peak-to-peak voltage could not be measured.\n");
else
printf("The voltage peak-to-peak is %f volts.\n", vpp );
} /* end auto_measurements() */
/* frequency channel 1 */
/* read in value and result flag */
/* frequency channel 1 */
/* read in value and result flag */
Sample Programs
Sample C Programs
6-9

Advertisement

Table of Contents
loading

Table of Contents