Keysight E4428C ESG RF Programming Manual page 107

Signal generators
Table of Contents

Advertisement

#include <conio.h>
void main ()
{
ViSession defaultRM, vi;
ViStatus viStatus = 0;
viStatus=viOpenDefaultRM(&defaultRM); // Initialize VISA session
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("\n");
printf("Press any key to continue\n");
getch();
viClear(vi);
viPrintf(vi, "*RST\n");
viPrintf(vi, "FM2:INT:FREQ 5 kHz\n"); // Sets FM path 2 to internal at a modulation rate of 5 kHz
viPrintf(vi, "FM2:DEV 100 kHz\n");
viPrintf(vi, "FREQ 900 MHz\n");
viPrintf(vi, "POW -15 dBm\n");
viPrintf(vi, "FM2:STAT ON\n");
viPrintf(vi, "OUTP:STAT ON\n");
printf("\n");
printf("Power level : -15 dBm\n");
printf("FM state : on\n");
printf("RF output : on\n");
printf("Carrier Frequency : 900 MHZ\n");
printf("Deviation : 100 kHZ\n");
printf("Internal modulation : 5 kHz\n");
printf("\n");
// Close the sessions
viClose(vi);
Keysight Signal Generators Programming Guide
// Declares variables of type ViSession
// for instrument communication
// Declares a variable of type ViStatus
// for GPIB verifications
// open session to gpib device at address 19
// If problems, then prompt user
// Clears the signal generator
// Resets the signal generator
// Sets FM path 2 modulation deviation rate of 100 kHz
// Sets carrier frequency to 900 MHz
// Sets the power level to -15 dBm
// Turns on frequency modulation
// Turns on RF output
// Prints a carriage return
// Print user information
// Print a carrage return
Programming Examples
GPIB Programming Interface Examples
99

Advertisement

Table of Contents
loading

Table of Contents