Agilent Technologies 86038A User Manual page 178

Optical dispersion analyzer
Table of Contents

Advertisement

Remote Operation
178
int
cnt;
double
x;
// Get the gain data from port one
gainData = odaClient.Results.YData(ODACommon.eMeasurement-
Type.Gain, ODACommon.eODAPort.One);
npoin=gainData.Length;
// Get the start and stop wavelengths
xStart = odaClient.Results.XStart(ODACommon.eMeasurement-
Type.Gain);
xStop = odaClient.Results.XStop(ODACommon.eMeasurement-
Type.Gain);
xStep = (xStop - xStart)/ (npoin - 1);
// Open the file
StreamWriter file = new StreamWriter(fileName, false);
file.WriteLine("Sample ODA File");
file.WriteLine("Wavelength (nm), Gain (dB)");
// Write the data
for (cnt=0;cnt<npoin;++cnt)
{
x = xStart + cnt * xStep;
buf = x.ToString() + ", " + gainData[cnt].ToString();
file.WriteLine(buf);
}
// Close the file
file.Close();
}
7 Run the software, connect and take a sweep. Look for c:\mydata.txt. You can
look at it with a text editor or import it into a spreadsheet.
This program will grab data even if sweep is triggered from front panel.
Tip:
Run the software, and then connect. Go to the ODA front panel and click
Local, then 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 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 sent to the ODA 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 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 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);
Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition

Advertisement

Table of Contents
loading

Table of Contents