Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide 99
Programming Examples
GPIB Programming Interface Examples
// 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
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...