Keysight E4428C ESG RF Programming Manual page 105

Signal generators
Table of Contents

Advertisement

// PROGRAM FILE NAME:visaex5.cpp
//
// PROGRAM DESCRIPTION:This example sets the signal generator FM source to External 2,
// coupling to AC, deviation to 20 kHZ, carrier frequency to 700 MHz and the power level
// to -2.5 dBm. The RF state is set to on.
//
//****************************************************************************************
#include <visa.h>
#include "StdAfx.h"
#include <iostream>
#include <stdlib.h>
#include <conio.h>
void main ()
{
ViSession defaultRM, vi;
ViStatus viStatus = 0;
viStatus=viOpenDefaultRM(&defaultRM);
viStatus=viOpen(defaultRM, "GPIB::19::INSTR", VI_NULL, VI_NULL, &vi);
if(viStatus){
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
printf("Example program to set up the signal generator\n");
printf("for an AC-coupled FM signal\n");
printf("Press any key to continue\n");
printf("\n");
getch();
printf("\n");
viPrintf(vi, "*RST\n");
viPrintf(vi, "FM:SOUR EXT2\n");
viPrintf(vi, "FM:EXT2:COUP AC\n");
viPrintf(vi, "FM:DEV 20 kHz\n");
viPrintf(vi, "FREQ 700 MHz\n");
Keysight Signal Generators Programming Guide
// Declares variables of type ViSession
// for instrument communication
// Declares a variable of type ViStatus
// for GPIB verifications
// Initialize VISA session
// open session to gpib device at address 19
// If problems, then prompt user
// Resets the signal generator
// Sets EXT 2 source for FM
// Sets FM path 2 coupling to AC
// Sets FM path 2 deviation to 20 kHz
// Sets carrier frequency to 700 MHz
Programming Examples
GPIB Programming Interface Examples
97

Advertisement

Table of Contents
loading

Table of Contents