6
Example 5 - Increased Tuning Linearity
Table 6-1. Program Description: Increased Tuning Linearity
Line No. Description
10 to 20 Dimension, and make common all variables.
50 to 90 Start, stop and step size are set here for the sweep range. Allow
di is the tolerance for wavelength
correction. All wavelength values entered in nm here. Numb tries is the maximum number of times
through the correction loop.
110 to 130 Set working variables to zero.
150 to 160 Tls (HP 8168E/F tunable laser source) is at HP-IB address 24, and the Mwm (HP 86120A multi-wavelength
meter) is at HP-IB address 20.
180 to 220 *CLS (clear status byte) and *RST (reset to default settings) the Tls and Mwm. *RST is important for the
Mwm because it must be in single trigger mode for line 420 to work (single trigger is the default mode).
230 For accuracy, the elevation must be sent to the Mwm in meters. The default is 0 m, so this line can be
omitted if used at sea level.
250 Enable the output of the Tls.
280 Start of the FOR .. NEXT loop for the wavelength sweep
. Start, stop and step values set in lines 50 to 70.
End of this loop is line 530.
300 to 310 Optional. Prints a blank line and then the programmed or \target" wavelength.
330 Convert the target wavelength in nm to meters, which is the default unit on the Tls and Mwm.
350 Program the Tls with the \target" wavelength.
360 to 370 The Tls must be settled (have nished tuning) before being read by the Mwm. The Tls will not respond to
*OPC? (operation complete) until it is settled.
390 Reset the correction loop counter.
410 The start of the wavelength correction loop. The loop ends at line 490.
420 This triggers a single wavelength measurement on the Mwm.
430 Enter the measured wavelength in the variable Current wl.
440 Calculate the wavelength dierence between Current wl (measured by the Mwm) and Target wl (to
which the Tls is set). This is the wavelength error.
450 Optional. Print the current (measured) wavelength (converted back to nm) and the dierence wavelength
(the error, converted to nm and rounded to four digits).
460 The correction loop is exited if either the Di wl (wavelength dierence or error) is less than or equal to
that set as Allow di (in line 80), or if this loop has been repeated Numb tries (set in line 90) times.Itis
necessary to take the absolute value of Di wl for the comparison. One half pm is added to Allow di,
and
<
is used as a way to accomplish
<
or = conditional. This avoids noise problems of less than 1 pm.
470 This is the special command to send the wavelength measured by the Mwm to the Tls for wavelength.
correction. The Tls internally compares this measured wavelength with the programmed wavelength (of
line 350) and attempts to correct it's output wavelength.
480 Increments the loop counter by 1.
490 End of the correction loop.
510 The Tls is corrected at this point. Put commands to read the receiver (power meter, *OSA , and so on) here.
530 End of the wavelength sweep loop.
6-16 Programming Examples