EasyManuals Logo

Agilent Technologies Infiniium DCA User Manual

Agilent Technologies Infiniium DCA
366 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #59 background imageLoading...
Page #59 background image
2-5
Sample Programs
C Programming Examples
* Return value: none
* Description: This routine performs automatic measurements of volts
* peak-to-peak and period on the acquired data. It also demonstrates
* two methods of error detection when using automatic measurements.
*/
void auto_measurements ( )
{
float period, vpp;
unsigned char vpp_str[16];
unsigned char period_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 analyzer
* will return the measurement and a result indicator. The result flag is zero
* if the measurement was successfully completed, otherwise a non-zero value is
* returned which indicates why the measurement failed. See the Programmer's Manual
* for descriptions of result indicators.
* 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. Note that this requires transmission of extra data from the scope.
*/
write_IO (":MEASure:SEND ON"); /* turn results on */
/* query -- volts peak-to-peak channel 1*/
write_IO (":MEASure:VPP? CHANnel1");
bytes_read = read_IO (vpp_str,16L); /* read in value and result flag */
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));
write_IO (":MEASure:PERiod? CHANnel1"); /* period channel 1 */
bytes_read = read_IO (period_str,16L); /* read in value and result flag */
if (period_str[bytes_read-2] != '0')
printf ("Automated period measurement error with result %c\n", period_str [bytes_read-2]);
else
printf ("Period is %f\n", (float) atof (period_str));
/* METHOD TWO - perform automated measurements and error checking with :MEAS:SEND OFF */
period = (float) 0;

Other manuals for Agilent Technologies Infiniium DCA

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies Infiniium DCA and is the answer not in the manual?

Agilent Technologies Infiniium DCA Specifications

General IconGeneral
BrandAgilent Technologies
ModelInfiniium DCA
CategoryTest Equipment
LanguageEnglish

Related product manuals