90 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
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
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...