Agilent Technologies 86038B User Manual page 201

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
' write data to spreadsheet
Dim npoin As Integer
Dim cnt As Integer
npoin = UBound(GainData) - LBound(GainData) + 1
ReDim XData(npoin)
For cnt = 0 To npoin - 1
XData(cnt) = XStart + cnt * xinc
Next cnt
Sheet1.Cells(9, 1).Value = "Wavelength"
Sheet1.Cells(10, 1).Resize(npoin).Value = _
Application.WorksheetFunction.Transpose(XData)
Sheet1.Cells(9, 2).Value = "Gain, dB"
Sheet1.Cells(10, 2).Resize(npoin).Value = _
Application.WorksheetFunction.Transpose(GainData)
Sheet1.Cells(9, 3).Value = "Group Delay, ps"
Sheet1.Cells(10, 3).Resize(npoin).Value = _
Application.WorksheetFunction.Transpose(GDData)
' Do a quick plot
Sheet1.Cells(9, 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select
Charts.Add
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
' Get rid of time data as a plotted series
.SeriesCollection(1).Delete
' Specify the X axis for the other two series
.SeriesCollection(1).XValues = Range(Sheet1.Cells(10, 1), Sheet1.Cells(9 + npoin,
1))
.SeriesCollection(2).XValues = Range(Sheet1.Cells(10, 1), Sheet1.Cells(9 + npoin,
1))
' set title
.HasTitle = True
.ChartTitle.Characters.Text = "Gain and Group Delay"
' Add x axis with title
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Wavelength, nm"
' Add left hand y axis with title
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Gain, dB"
.Axes(xlValue, xlPrimary).CrossesAt = -200
' Add right hand y axis with title
.SeriesCollection(2).Select
.SeriesCollection(2).AxisGroup = 2
.Axes(xlValue, xlSecondary).HasTitle = True
.Axes(xlValue, xlSecondary).AxisTitle.Characters.Text = "delay, ps"
' Move the legend to the bottom of the plot
.Legend.Position = xlLegendPositionBottom
End With
201

Advertisement

Table of Contents
loading

Table of Contents