84 Keysight CXG, EXG, and MXG X-Series Signal Generators Programming Guide
Programming Examples
GPIB Programming Interface Examples
rdVal[ibcntl] = '\0'; // Null character indicating end
of array
cout<<"Source CW frequency is "<<rdVal; // Print frequency of
signal generator
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, "POW:AMPL?",10); // Querys the signal generator
ibrd(sig, rdVal,100); // Reads the signal generator
power level
rdVal[ibcntl] = '\0'; // Null character indicating end
of array
// Prints signal generator power
level
cout<<"Source power (dBm) is : "<<rdVal;
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, ":FREQ:MODE?",11); // Querys source frequency mode
ibrd(sig, rdVal,100); // Enters in the source frequency
mode
rdVal[ibcntl] = '\0'; // Null character indicating end
of array
cout<<"Source frequency mode is "<<rdVal; // Print source
frequency mode
cout<<"Press any key to continue"<<endl;
cin.ignore(10000,'\n');
ibwrt(sig, "OUTP OFF",12); // Turns off RF source
ibwrt(sig, "OUTP?",5); // Querys the on/off state of the
instrument
ibrd(sig,rdVal,2); // Enter in the source state
rdVal[ibcntl] = '\0';
num = (int (rdVal[0]) -('0'));
if (num > 0){
cout<<"Source RF state is : On"<<endl;
}else{
cout<<"Source RF state is : Off"<<endl;}
cout<<endl;
ibwrt(sig, "*IDN?",5); // Querys the instrument ID
Содержание X-Series
Страница 4: ...4 ...
Страница 10: ...10 Contents ...