Keysight E4428C ESG RF Programming Manual page 113

Signal generators
Table of Contents

Advertisement

if(viStatus){// If problems, then prompt user
printf("Could not open ViSession!\n");
printf("Check instruments and connections\n");
printf("\n");
exit(0);}
printf("\n");
viClear(vi);
viPrintf(vi, "*CLS\n");
printf("Programming example using the
printf("used to save and recall an instrument's state\n");
printf("\n");
viPrintf(vi, "*RST\n");
viPrintf(vi, "FREQ 5 MHz\n");
viPrintf(vi, "POW:ALC OFF\n");
viPrintf(vi, "POW:AMPL -3.2 dBm\n");
viPrintf(vi, "OUTP:STAT ON\n");
viPrintf(vi, "*OPC?\n");
while (!lngDone)
viScanf (vi ,"%d",&lngDone);
viPrintf(vi, "*SAV 1\n");
printf("The current signal generator operating state will be saved\n");
printf("to Register #1. Observe the state then press Enter\n");
printf("\n");
getch();
lngDone=0;
viPrintf(vi, "*RST\n");
viPrintf(vi, "*OPC?\n");
while (!lngDone)
viScanf (vi ,"%d",&lngDone);
printf("The instrument is now in it's Reset operating state. Press the\n");
printf("Enter key to return the signal generator to the Register #1
printf("\n");
getch();
lngDone=0;
viPrintf(vi, "*RCL 1\n");
viPrintf(vi, "*OPC?\n");
while (!lngDone)
viScanf (vi ,"%d",&lngDone);
Keysight Signal Generators Programming Guide
// Clears the signal generator
// Resets the status byte register
// Print user information
*SAV,*RCL
SCPI commands\n");
// Resets the signal generator
// Sets sig gen frequency
// Turns ALC Off
// Sets power for -3.2 dBm
// Turns RF output On
// Checks for operation complete
// Waits for setup to complete
// Saves sig gen state to register #1
// Print user information
// Prints new line character
// Wait for user input
// Resets the operation complete flag
// Resets the signal generator
// Checks for operation complete
// Waits for setup to complete
// Print user infromation
// Prints new line character
// Waits for user input
// Reset the operation complete flag
// Recalls stored register #1 state
// Checks for operation complete
// Waits for setup to complete
// Print user information
Programming Examples
GPIB Programming Interface Examples
state\n");
105

Advertisement

Table of Contents
loading

Table of Contents