Keysight E4428C ESG RF Programming Manual page 99

Signal generators
Table of Contents

Advertisement

// a query.
//
//*************************************************************************************
#include "stdafx.h"
#include <iostream>
#include "windows.h"
#include "Decl-32.h"
using namespace std;
int GPIB0=
0;
Addr4882_t Address[31];
int main()
{
int sig;
int num;
char rdVal[100];
sig = ibdev(0, 19, 0, 13, 1, 0); // Open and initialize a device descriptor
ibloc(sig);
ibclr(sig);
ibwrt(sig, "*RST", 4);
ibwrt(sig, ":FREQuency:CW?",14); // Querys the CW frequency
ibrd(sig, rdVal,100);
rdVal[ibcntl] = '\0';
cout<<"Source CW frequency is "<<rdVal;
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, "POW:AMPL?",10);
ibrd(sig, rdVal,100);
rdVal[ibcntl] = '\0';
cout<<"Source power (dBm) is : "<<rdVal;
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, ":FREQ:MODE?",11);
ibrd(sig, rdVal,100);
rdVal[ibcntl] = '\0';
cout<<"Source frequency mode is "<<rdVal; // Print source frequency mode
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, "OUTP OFF",12);
Keysight Signal Generators Programming Guide
// Board handle
// Declare a variable of type Addr4882_t
// Declares variable to hold interface descriptor
// Declares variable to read instrument responses
// Places the signal generator in local mode
// Sends Selected Device Clear(SDC) message
// Places signal generator in a defined state
// Reads in the response into rdVal
// Null character indicating end of array
// Print frequency of signal generator
// Querys the signal generator
// Reads the signal generator power level
// Null character indicating end of array
// Prints signal generator power level
// Querys source frequency mode
// Enters in the source frequency mode
// Null character indicating end of array
// Turns off RF source
Programming Examples
GPIB Programming Interface Examples
91

Advertisement

Table of Contents
loading

Table of Contents