The analyzer control interface is simple:
The IP address is the network IP address of the analyzer. It is a fixed value and can be operated manually on the meter. cf is the center frequency, which is the center frequency of the analyzer we want to set. rbw, vbw our teaching and research section uses 3 kHz, 100Hz, span bandwidth, swtime scanning time; Ref, reference level, SCA/Div, which is the Electrical adjustment represented by each grid on the analyzer, points is the number of scanned points. Each item can be set separately, or after the parameter is determined, click setall to set all at once.
The response code of the set all button is:
setCF(); setSpan(); setRBW(); setVBW(); setSTIme(); setpoints(); setREF(); setscale();
The encapsulated functions of each setting are called here.
Void ctestdlg: setcf () {vistring stripinst0; stripinst0 = "tcpip0: 10.10.150.150: inst0: instr"; // cstring S1, S2, S3; // S1 = "tcpip0:"; S2 = ": inst0: instr"; // S3 = S1 + tempip + S2; // stripinst0 = s3.getbuffer (0 ); visession defaultrm, VI; char Buf [256] = {0}; viopendefaultrm (& defaultrm); viopen (defaultrm, stripinst0, vi_null, vi_null, & VI); vistring strcommand; cstring snum, S2, S3; getdlgitem (idc_edit1)-> getwindowtext (snum); cstring scom; getdlgitem (idc_combo1)-> getwindowtext (scom ); if (scom = "MHz") {S3 = ": freq: Cent" + snum + "E6 \ n"; viprintf (Vi, s3.getbuffer (0 )); // MessageBox ("MHz");} else if (scom = "kHz") {S3 = ": freq: Cent" + snum + "E3 \ n "; viprintf (Vi, s3.getbuffer (0); // MessageBox ("kHz");} else {S3 = ": freq: Cent" + snum + "\ n "; viprintf (Vi, s3.getbuffer (0); // MessageBox ("HZ");} // viprintf (Vi, ": freq: center 955.0e6 \ n "); viclose (VI); viclose (defaultrm );}