4-35
Programming
Example Programs
! Query reference wavelengths and powers
OUTPUT @Mwm;":CALC3:DATA? WAV"
ENTER @Mwm USING "#,K";Current_ref_wl(*)
OUTPUT @Mwm;":CALC3:DATA? POW"
ENTER @Mwm USING "#,K";Current_ref_pwr(*)
! Turn off drift reference state
Cmd_opc(":CALC3:DRIF:REF:STAT OFF")
Err_mngmt(":CALC3:DRIF:REF:STAT OFF")
! Turn on drift max min calculation
Cmd_opc(":CALC3:DRIF:DIFF:STAT ON")
Err_mngmt(":CALC3:DRIF:DIFF:STAT ON")
Tempo(10)
ALLOCATE Current_diff_wl(1:Nb_pt)
ALLOCATE Current_diff_pw(1:Nb_pt)
! Query drift wavelengths and powers
OUTPUT @Mwm;":CALC3:DATA? WAV"
ENTER @Mwm USING "#,K";Current_diff_wl(*)
OUTPUT @Mwm;":CALC3:DATA? POW"
ENTER @Mwm USING "#,K";Current_diff_pw(*)
OFF TIMEOUT
FOR I=1 TO Nb_pt
PRINT USING "18A,2D,6A,M4D.2DE,3A,21A,MDD.3DE,3A";"Wavelength number "
;I;" is : ";Current_ref_wl(I);" m";" with a drift from : ";Current_diff_wl(I);" m"
PRINT USING "28A,SDD.2DE,4A,20A,MDD.3DE,3A,/";"it has a power level of
: ";Current_ref_pwr(I);" dBm";" with a drift from : ";Current_diff_pw(I);" dB";
NEXT I
STOP
Error_msg: !
PRINT "The program is aborted due to : ";ERRM$
END