EasyManuals Logo

Agilent Technologies EMC Series Programmer's Guide

Agilent Technologies EMC Series
349 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 #165 background imageLoading...
Page #165 background image
Chapter 3 165
Programming Examples
Measuring Harmonic Distortion (GPIB)
/* Open a GPIB session at address 18*/
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM,"GPIB0::18",VI_NULL,VI_NULL,&viESA);
if(viStatus)
{
printf("Could not open a session to GPIB device at address 18!\n");
exit(0);
}
/*Clear the instrument*/
viClear(viESA);
/*Reset the instrument*/
viPrintf(viESA,"*RST\n");
/*Display the program heading */
printf("\n\t\t Harmonic Distortion Program \n\n" );
/* Check for the instrument model number and route the 50MHz-signal accordingly*/
Route50MHzSignal();
/*Prompt user for fundamental frequency*/
printf("\t Enter the input signal fundamental frequency in MHz ");
/*The user enters fundamental frequency*/
scanf("%lf",&dFundamental);
/*Set the analyzer center frequency to the fundamental frequency. */
viPrintf(viESA,"SENS:FREQ:CENT %lf MHZ \n;",dFundamental);
/*Set the analyzer to 10MHz Span */
viPrintf(viESA,"SENS:FREQ:SPAN 10 MHZ\n");
/*Put the analyzer in a single sweep */
viPrintf(viESA,"INIT:CONT 0 \n");
/*Trigger a sweep, wait for sweep completion*/
viPrintf(viESA,"INIT:IMM;*WAI\n");
/*Perform a peak search */
viPrintf(viESA,"CALC:MARK:MAX \n");
/* Place the signal at the reference level using the
marker-to-reference level command and take sweep */
viPrintf(viESA,"CALC:MARK:SET:RLEV \n");
/*Trigger a sweep, wait for sweep completion*/

Table of Contents

Other manuals for Agilent Technologies EMC Series

Questions and Answers:

Question and Answer IconNeed help?

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

Agilent Technologies EMC Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelEMC Series
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals