EasyManuals Logo
Home>Agilent Technologies>Test Equipment>E4406A VSA Series

Agilent Technologies E4406A VSA Series User Manual

Agilent Technologies E4406A VSA Series
420 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 #131 background imageLoading...
Page #131 background image
Chapter 3 131
Programming Examples
Saving Binary Trace Data in an ASCII File
Example:
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include "visa.h"
void main ()
{
/*program variable*/
ViSession defaultRM, viVSA;
ViStatus viStatus = 0;
char sTraceBuffer[10240] = {0};
char sBufferInfo[4] = {0};
FILE *fTraceFile;
long lNumberPoints = 0;
long lNumberBytes = 0;
long lComplete = 0;
unsigned long lBytesRetrieved;
ViReal64 adTraceArray[10240];
/*open session to GPIB device at address 18 */
viStatus=viOpenDefaultRM (&defaultRM);
viStatus=viOpen (defaultRM, "GPIB0::18::INSTR",
VI_NULL,VI_NULL, &viVSA);
/*check opening session sucess*/
if(viStatus)
{
printf("Could not open a session to GPIB device at
address 18!\n");
exit(0);
}
/* Reset device */
viPrintf(viVSA, "*RST\n");
/*set the input port to the internal 50MHz reference
source*/
viPrintf(viVSA, "SENS:FEED AREF\n");
/*zoom the spectrum display*/
viPrintf(viVSA, "DISP:FORM:ZOOM1\n");
/*tune the instrument to 50MHz*/
viPrintf(viVSA, "SENS:FREQ:CENT 50E6\n");
/*print message to the standard output*/
viPrintf(viVSA, "Getting the spectrum trace in binary
format...\nPlease wait...\n\n");
/*set the instrument in single mode*/
viPrintf(viVSA, "INIT:CONT 0\n");
/*Set the ouput format to a binary format.
viPrintf(viVSA, "FORM REAL,64\n");

Table of Contents

Other manuals for Agilent Technologies E4406A VSA Series

Questions and Answers:

Question and Answer IconNeed help?

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

Agilent Technologies E4406A VSA Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelE4406A VSA Series
CategoryTest Equipment
LanguageEnglish

Related product manuals