Agilent Technologies Agilent 86120C Ventilation Hood User Manual


 
3-32
Programming
Example Programs
Example 2. Measure WDM channels
This program measures the multiple laser lines of a WDM system. It
measures both the power and wavelengths of each line. First, the pro-
gram sets the Agilent 86120C in the single-acquisition measurement
mode. Then, it triggers the Agilent 86120C with the MEASure com-
mand to capture measurement data of the input spectrum. Because the
data is stored in the instrument’s memory, it can be queried as
needed.
Refer to the introduction to this section for a description of each sub-
routine that is contained in this program.
COM /Instrument/ @Mwm
ASSIGN @Mwm TO 720
ON ERROR GOTO Error_msg,
Set_ese
PRINT USING "37A,33A";"Multi-Wavelength Meter Identity is : ";FNIdentity$
OUTPUT @Mwm;":INIT:CONT OFF"
ON TIMEOUT 7,5 CALL Err_mngmt
OUTPUT @Mwm;":MEAS:ARR:POW:WAV?"
ENTER @Mwm USING "#,K";Nb_wl
ALLOCATE Current_wl(1:Nb_wl)
ENTER @Mwm USING "#,K";Current_wl(*)
OUTPUT @Mwm;":FETC:ARR:POW?"
ENTER @Mwm USING "#,K";Nb_wl
ALLOCATE Current_pwr(1:Nb_wl)
ENTER @Mwm USING "#,K";Current_pwr(*)
FOR I=1 TO Nb_wl
PRINT USING "22A,2D,6A,4D.2DE,4A,S2D.2D,3A";"The wavelength number
";Current_wl(I);" at ";Current_pwr(I);"dBm"
NEXT I
OFF TIMEOUT
STOP
Error_msg:
PRINT "the prgm is aborted due to : ";ERRM$
END
Err_mngmt:SUB Err_mngmt
COM /Instrument/ @Mwm
DIM Err_msg$[255]
INTEGER Cme
CLEAR 7
REPEAT
OUTPUT @Mwm; "*ESR?"
ENTER @Mwm;Cme
OUTPUT @Mwm; ":SYST:ERR?"
ENTER @Mwm;Err_msg$