Agilent 86038B Photonic Dispersion and Loss Analyzer,
Second Edition
195
Control Center Wavelength
This section shows how to control the center wavelength on the
PDLA. First, a text box is added for the user to enter the desired
value, and then the entered value will sent to the PDLA as part
of the sweep.
1 Add a text field, name it txtCenter, default text to 1550. Then
add a label that says Center Wavelength, nm:.
2 Modify the take sweep function to send the value to the
PDLA. Find the function pbSweep_click, and add the
following lines to check the value and send it to the PDLA.
The PDLA thinks in terms of start/stop, so you have to
convert the center wavelength to a start and stop wavelength:
// Get the center wavelength
double centerWavel, startWavel, stopWavel, oldSpan;
centerWavel = double.Parse(txtCenter.Text);
if (centerWavel < 0 || centerWavel > 1700) {
MessageBox.Show("Center Wavelength out of range, defaulted to 1550 nm");
centerWavel=1550;
txtCenter.Text = centerWavel.ToString();
}
// Convert center to start, stop
startWavel=pdlaClient.MeasurementRange.XStart;
stopWavel=pdlaClient.MeasurementRange.XStop;
oldSpan=stopWavel - startWavel;
// Write new start and stop
pdlaClient.MeasurementRange.XStart=centerWavel - oldSpan/2;
pdlaClient.MeasurementRange.XStop=cente oldSpan/2;
3 It works better if you first set the PDLA to a relatively narrow
sweep, such as 1530 to 1540 nm.
Complete Source Code
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
using Agilent.LWD.Ag86038x.InstrumentObjects;
using Agilent.LWD.Ag86038x;
namespace WindowsApplication1
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
Summary of Contents for 86038B
Page 1: ...Agilent 86038B Photonic Dispersion and Loss Analyzer User s Guide ...
Page 4: ...4 ...
Page 20: ...20 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 34: ...34 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition Figure 2 b Rear Panel ...
Page 78: ...78 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 92: ...92 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 202: ...202 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition End Sub ...
Page 348: ...348 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 349: ......