Keysight E4428C ESG RF Programming Manual page 96

Signal generators
Table of Contents

Advertisement

Programming Examples
GPIB Programming Interface Examples
// PROGRAM NAME: niex2.cpp
//
// PROGRAM DESCRIPTION: This program will place the signal generator into
// LOCAL LOCKOUT mode. All front panel keys, except the Contrast key, will be disabled.
// The local command, 'ibloc(sig)' executed via program code, is the only way to
// return the signal generator to front panel, Local, control.
// ************************************************************************************
#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;
sig = ibdev(0, 19, 0, 13, 1, 0);
ibclr(sig);
ibwrt(sig, "*RST", 4);
cout << "The signal generator should now be in REMOTE. The remote mode R "<<endl;
cout <<"annunciator should appear on the signal generator display."<<endl;
cout <<"Press Enter to continue"<<endl;
cin.ignore(10000,'\n');
SendIFC(GPIB0);
Address[0]=19;
Address[1]=NOADDR;
SetRWLS(GPIB0, Address);
cout<< "The signal generator should now be in LOCAL LOCKOUT. Verify that all
keys"<<endl;
cout<< "including the 'Local' key are disabled (Contrast keys are not
affected)"<<endl;
cout <<"Press Enter to continue"<<endl;
cin.ignore(10000,'\n');
ibloc(sig);
cout<<endl;
cout <<"The signal generator should now be in local mode\n";
return 0;}
}
88
// Board handle
// Declares a variable of type Addr4882_t
// Declares variable to hold interface descriptor
// Opens and initialize a device descriptor
// Sends GPIB Selected Device Clear (SDC) message
// Places signal generator in a defined state
// Resets the GPIB interface
// Signal generator's address
// Signifies end element in array. Defined in
// DECL-32.H
// Places device in Remote with Lockout State.
// Returns signal generator to local control
Keysight Signal Generators Programming Guide

Advertisement

Table of Contents
loading

Table of Contents