Keysight E4428C ESG RF Programming Manual page 110

Signal generators
Table of Contents

Advertisement

Programming Examples
GPIB Programming Interface Examples
// sweep from 1-2 GHz. A loop and counter are used to generate 5 sweeps.
// Each sweep consists of 101 points with a .01 second dwell at each point.
//
// The program uses a Sleep function to allow the signal generator to
// complete it's sweep operation before the INIT command is sent.
// The Sleep function is available with the windows.h header file which is
// included in the project.
//
// NOTE: Change the TCPIP0 address in the instOpenString declaration to
// match the IP address of your signal generator.
//
//************************************************************************
#include "stdafx.h"
#include "visa.h"
#include <iostream>
#include <windows.h>
void main ()
{
ViStatus stat;
ViSession defaultRM,inst;
int npoints = 101;
double dwell = 0.01;
int intCounter=5;
char* instOpenString = "TCPIP0::141.121.93.101::INSTR";
stat = viOpenDefaultRM(&defaultRM);
stat = viOpen(defaultRM,instOpenString,VI_NULL,VI_NULL, &inst);
// preset to start clean
stat = viPrintf( inst, "*RST\n" );
// set power level for -10dBm
stat = viPrintf(inst, "POW -10DBM\n");
// set the start and stop frequency for the sweep
stat = viPrintf(inst, "FREQ:START 1GHZ\n");
stat = viPrintf(inst, "FREQ:STOP 2GHZ\n");
// setup dwell per point
stat = viPrintf(inst, "SWEEP:DWELL %e\n", dwell);
// setup number of points
102
Keysight Signal Generators Programming Guide

Advertisement

Table of Contents
loading

Table of Contents