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 #119 background imageLoading...
Page #119 background image
Chapter 3 119
Programming Examples
Reading Trace Data using ASCII Format (GPIB)
viPrintf(viESA,"SENS:FREQ:SPAN 50 MHz\n");
/*Set the analyzer to single sweep mode */
viPrintf(viESA,"INIT:CONT 0 \n");
/*Trigger a sweep and wait for sweep to complete */
viPrintf(viESA,"INIT:IMM;*WAI\n");
/* Specify units in dBm*/
viPrintf(viESA,"UNIT:POW DBM \n");
/*Set analyzer trace data format to ASCII Format*/
viPrintf(viESA,"FORM:DATA ASC \n");
/*Trigger a sweep and wait for sweep to complete */
viPrintf(viESA,"INIT:IMM;*WAI\n");
/*Query the Trace Data using ASCII Format */
viQueryf(viESA,"%s\n", "%#t","TRAC:DATA? TRACE1" , &iNum , cResult);
/*Remove the "," from the ASCII trace data for analyzing data*/
cToken = strtok(cResult,",");
/*Save trace data to an ASCII to a file, by removing the "," token*/
fTraceFile=fopen("C:\\temp\\ReadAscGpib.txt","w");
fprintf(fTraceFile,"ReadAscGpib.exe Output\nAgilent Technologies 2000\n\n");
fprintf(fTraceFile,"\tAmplitude of point[%d] = %s dBm\n",lCount+1,cToken);
while (cToken != NULL)
{
lCount++;
cToken =strtok(NULL,",");
if (lCount != iSwpPnts)
fprintf(fTraceFile,"\tAmplitude of point[%d] = %s
dBm\n",lCount+1,cToken);
}
fprintf(fTraceFile,"\nThe Total trace data points of the spectrum are
:[%d]
\n\n",lCount);
fclose(fTraceFile);
/*Close the session*/
viClose(viESA);
viClose(defaultRM);
}

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