Agilent Technologies 86120B Marine Instruments User Manual


 
4-42
Programming
Example Programs
COM Current_wl,Diff_wl.Target_wl,Previous_diff,Diff_diff
Current_wl=0
Diff_wl=0
Target_wl=0
Previous_diff=O
Diff_diff=0
ASSIGN @Tls TO 724
ASSIGN @Mwm TO 720
! Initialize instrument
DIM Identity$[50]
Identity$=""
OUTPUT @Tls;"*CLS"
OUTPUT @Tls;"*IDN?"
ENTER @TLS;identity$
PRINT "TLS IS A ";identity$
OUTPUT @Mwm;"*RST"
OUTPUT @Mwm;"*CLS"
OUTPUT @Mwm;"*IDN?"
ENTER @Mwm;Identity$
PRINT "MWM IS A ";identity$
! Ask user for desired wavelength
INPUT "What wavelength (nm)do you wish to have",Target_wl
Target_wl=Target_wl*1.OE-9
PRINT "the target wavelength is : ";Target_wl
! Set wavelength of tunable laser source
OUTPUT @Tls; ":WAVE ";VAL$(Target_wl)
OUTPUT @Tls; ":OUTP ON"
! Enter realignment loop
REPEAT
OUTPUT @Mwm;":MEAS:SCAL:POW:WAV?"
ENTER @Mwm;Current_wl
PRINT "The current wavelength is : ";VAL$(Current_wl)
Diff_wl=PROUND(ABS(Target_wl-Current_wl),-16)
PRINT "Diff between target & Current is (+ or -) : ";VAL$(Diff_wl)
OUTPUT @Tls;":WAVEACT ";VAL$(Current_wl)
Diff_diff=PROUND(ABS(Diff_wl-Previous_diff),-16)
PRINT "differential difference between two turn : ";VAL$(Diff_diff)
Previous_diff=Diff_wl
UNTIL (Diff_wl<1.5*1.0E-12) OR (Diff_diff=0)
END