Agilent Technologies 86038A User Manual page 169

Optical dispersion analyzer
Table of Contents

Advertisement

Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition
take a sweep. You will see the update messages appear on our application, and
the application will detect end-of-sweep and transfer the data.
8 Exit the application when you are done.
Control Center Wavelength
This section shows how to control the center wavelength on the ODA.
First, a text box is added for the user to enter the desired value, and then
the entered value will be sent to the ODA as part of the sweep.
1 Add a text field, name it txtCenter, set the default text to 1550. Add a label with
the text, Center Wavelength, nm.
2 Modify the take sweep function to send the value to the ODA. Find the function
pbSweep_click, and add the following lines to check the value and send it to
the ODA. The ODA thinks in terms of start/stop, so the center wavelength must
be converted to a start and stop wavelength. Find the pbSweep_click method,
and insert the following code immediately before odaClient.measure:
Dim centerWavel, startWavel, stopWavel, span, oldCenter As Double
startWavel = odaClient.MeasurementRange.XStart
stopWavel = odaClient.MeasurementRange.XStop
span = stopWavel - startWavel
centerWavel = CDbl(txtCenter.text)
If centerWavel < 1400 Or centerWavel > 1700 Then
MessageBox.Show("Wavelength out of range, defaulted to
1550")
centerWavel = 1550
txtCenter.Text = "1550"
End If
odaClient.MeasurementRange.XStart = centerWavel - span / 2
odaClient.MeasurementRange.XStop = centerWavel + span / 2
3 It works better if you first set the ODA to a relatively narrow sweep, such as 1530
to 1540 nm.
Complete Source Code
Public Class Form1
Inherits System.Windows.Forms.Form
Private WithEvents odaClient As RemoteClient.Communicator
' Windows form generated code omitted
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
odaClient = New RemoteClient.Communicator()
End Sub
Private Sub pbConnect_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles pbConnect.Click
odaClient.Connectivity.Connect(tbOdaName.Text)
pbConnect.Enabled = False
Remote Operation
169

Advertisement

Table of Contents
loading

Table of Contents