Agilent Technologies 86120B Marine Instruments User Manual


 
4-38
Programming
Example Programs
I=1)*Delta_wl(1)))/1.0E-9;" nm. Absolute line level is : ";Delta_pwr(I)+(NOT I=1)*Delta_pwr(1);"
dBm"
PRINT USING "17A,2D,6A,M4D.3D,23A,2D,6A,S2D.2D,3A";"Delta Wl to line ",I+1," is :
";(Delta_wl(I+1)-(NOT I=1)*Delta_wl(I))/1.E-9;" nm, Delta Pwr to line ",I+1," is :
";(I=1)*(Delta_pwr(I+1))+(NOT I=1)*(Delta_pwr(I+1)-Delta_pwr(I));" dB"
NEXT I
PRINT USING "6A,2D,17A,M4D.3D,31A,S2D.2D,4A";"Line : ";I;" wavelength is :
";(Delta_wl(1)+Delta_wl(Nb_pt))/1.0E-9;" nm. Absolute line level is :
";Delta_pwr(1)+Delta_pwr(Nb_pt);" dBm"
STOP
Error_msg: !
PRINT "The program is aborted due to : ";ERRM$
END
Err_mngmt:SUB Err_mngmt(OPTIONAL Cmd_msg$)
COM /Instrument/ @Mwmt
DIM Err_msg$[255]
INTEGER Cme
CLEAR @Mwm
REPEAT
OUTPUT @Mwm;"*ESR?"
ENTER @Mwm;Cme
OUTPUT @Mwm;":SYST:ERR?"
ENTER @Mwm;Err_msg$
IF NPAR>0 AND NOT POS(Err_msg$,"+0") THEN PRINT "This command ";Cmd_msg$;" makes
the following error :"
IF NOT POS(Err_msg$,"+0") THEN PRINT Err_msg$
UNTIL NOT BIT(Cme,2) AND NOT BIT(Cme,4) AND NOT BIT(Cme,5) AND POS(Err_msg$,"+0")
Subend:SUBEND
Set_ese:SUB Set_ese
COM /Instrument/ @Mwm
OUTPUT @Mwm;"*ESE ";IVAL("00110100",2)
SUBEND
Identity:DEF FNIdentity$;
COM /Instrument/ @Mwm
DIM Identity$[33]
Identity$=""
OUTPUT @Mwm;"*RST"
OUTPUT @Mwm;"*OPC?"
ENTER @Mwm;Opc_done
OUTPUT @Mwm;"*IDN?"
ENTER @Mwm;Identity$
RETURN Identity$
FNEND
Cmd_opc:SUB Cmd_opc(Set_cmd$)
COM /Instrument/ @Mwm
OUTPUT @Mwm;Set_cmd$
OUTPUT @Mwm;"*OPC?"
ENTER @Mwm;Opc_done$
SUBEND