3-32
Programming
Example Programs
Example 2. Measure WDM channels
This p rogram measures the multip le laser lines of a WDM system. It
measures both the p ower and wavelengths of each line. First, the p ro-
gram sets the Agilent 86120C in the single- acquisition measurement
mode. Then, it triggers the Agilent 86120C with the MEASure com-
mand to cap ture measurement data of the inp ut sp ectrum. 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$
Summary of Contents for 86120C
Page 12: ......
Page 26: ...1 14 Getting Started Returning the Instrument for Service ...
Page 27: ...1 15 Getting Started Returning the Instrument for Service ...
Page 28: ......
Page 96: ...3 18 Programming Monitoring the Instrument ...
Page 128: ...3 50 Programming Lists of Commands ...
Page 236: ...4 108 Programming Commands UNIT Subsystem ...
Page 248: ......
Page 264: ...6 16 Specifications and Regulatory Information Product Overview ...
Page 269: ...7 5 Reference Menu Maps Appl s Menu ...
Page 271: ...7 7 Reference Menu Maps Display List by WL Menu Delta On Menu ...
Page 273: ...7 9 Reference Menu Maps System Print Menu ...
Page 274: ...7 10 Reference Menu Maps System Setup Menu ...
Page 284: ......
Page 292: ......
Page 293: ......