Agilent Technologies 86038B User Manual page 195

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

Control Center Wavelength
Complete Source Code
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
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=centerWavel + oldSpan/2;
3 It works better if you first set the PDLA to a relatively narrow
sweep, such as 1530 to 1540 nm.
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
{
195

Advertisement

Table of Contents
loading

Table of Contents