Agilent Technologies 86038B User Manual page 176

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

176
Dim gainData() As Double
Dim xStart As Double
Dim xStop As Double
Dim xStep As Double
Dim npoin As Integer
Dim cnt As Integer
Dim idx As Integer
Dim buf As String
' Get the data and figure out the wavelength axis
gainData = pdlaClient.Results.YData _
(eMeasurementType_Gain,eODAPort_One)
npoin = UBound(gainData) - LBound(gainData)+1
xStart = pdlaClient.Results.xStart(eMeasurementType_Gain)
xStop = pdlaClient.Results.xStop(eMeasurementType_Gain)
xStep = (xStop - xStart) / (npoin - 1)
' Open the file and write the data
Dim outputFileNum As Integer
outputFileNum = 123
Open fileName For Output As outputFileNum
Write #outputFileNum, "Sample PDLA File written from VB 6.0"
Write #outputFileNum, Now
Write #outputFileNum, "Wavelength (nm)", "Gain (dB)"
idx = 0
For cnt = LBound(gainData) To UBound(gainData)
buf = CStr(xStart + xStep * idx) + "," + CStr(gainData(cnt))
Write #outputFileNum, xStart + xStep * idx, gainData(cnt)
idx = idx + 1
Next
Close #outputFileNum
End Sub
Private Sub pbConnect_Click()
' Connect to the PDLA
Call pdlaClient.Connectivity.Connect(tbPdlaName.Text)
' Grey out the button so we don't double-connect
pbConnect.Enabled = False
End Sub
Private Sub pbSweep_Click()
' Don't do anything if not connected to PDLA
If pdlaClient.Connectivity.IsConnected = False Then
MsgBox ("Can't take a measurement yet - not connected.")
Exit Sub
End If
' Set the start wavelength
Dim centerWavel, startWavel, stopWavel, span, oldCenter As Double
startWavel = pdlaClient.MeasurementRange.xStart
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition

Advertisement

Table of Contents
loading

Table of Contents