Agilent Technologies E8663B Portable Generator User Manual


 
Agilent N518xA, E8663B, E44x8C, and E82x7D Signal Generators Programming Guide 79
Programming Examples
GPIB Programming Interface Examples
viPrintf(vi, "FREQ:CW?\n"); // Query the CW frequency
viScanf(vi, "%t", rdBuffer); // Read signal generator response
printf("Source CW frequency is : %s\n", rdBuffer); // Print the frequency
viPrintf(vi, "POW:AMPL -2.3 dBm\n"); // Set the power level to -2.3 dBm
viPrintf(vi, "POW:AMPL?\n"); // Query the power level
viScanf(vi, "%t", rdBuffer); // Read the response into rdBuffer
printf("Source power (dBm) is : %s\n", rdBuffer); // Print the power level
viPrintf(vi, "OUTP:STAT ON\n"); // Turn source RF state on
viPrintf(vi, "OUTP?\n"); // Query the signal generator's RF state
viScanf(vi, "%1i", &num); // Read the response (integer value)
// Print the on/off RF state
if (num > 0 ) {
printf("Source RF state is : on\n");
}else{
printf("Source RF state is : off\n");
}
printf("\n");
printf("Verify RF state then press continue\n");
printf("\n");
getch();
viClear(vi);
viPrintf(vi,"OUTP:STAT OFF\n"); // Turn source RF state off
viPrintf(vi, "OUTP?\n"); // Query the signal generator's RF state
viScanf(vi, "%1i", &num); // Read the response
// Print the on/off RF state
if (num > 0 ) {
printf("Source RF state is now: on\n");
}else{
printf("Source RF state is now: off\n");
}
// Close the sessions
printf("\n");
viClear(vi);
viClose(vi);
viClose(defaultRM);
}
Generating an Externally Applied AC-Coupled FM Signal Using VISA and C
In this example, the VISA library is used to generate an ac-coupled FM signal at a carrier frequency
of 700 MHz, a power level of 2.5 dBm, and a deviation of 20 kHz. Before running the program:
Connect the output of a modulating signal source to the signal generator’s EXT 2 input connector.
Set the modulation signal source for the desired FM characteristics.