200
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition
Example 2: Control from Excel
Complete Source Code
Option Explicit
Private WithEvents m_PDLARemoteControl As RemoteClient.Communicator
Public Sub initPdlaLink()
Set m_PDLARemoteControl = New RemoteClient.Communicator
End Sub
Public Sub closePdlaLink()
m_PDLARemoteControl.Connectivity.Disconnect
End Sub
Private Sub GoButton_Click()
' Clear the previous data
Sheet1.Cells(9, 1).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Clear
If Sheet1.ChartObjects.Count > 0 Then
Sheet1.ChartObjects(1).Delete ' Delete last chart
End If
' Open session
m_PDLARemoteControl.Connectivity.Connect (PDLA_ID_Box.Value)
' Wait for PDLA connection to come alive
DoEvents
Application.Wait (Now + TimeValue("0:00:01"))
DoEvents
While m_PDLARemoteControl.Connectivity.IsConnected = False
Application.Wait (Now + TimeValue("0:00:01"))
DoEvents
Wend
' Read x axis info
Dim XStart As Double
Dim xinc As Double
Dim XData() As Double
XStart = m_PDLARemoteControl.Results.XStart(eMeasurementType_Gain)
xinc = m_PDLARemoteControl.Results.Increment
'Get CD Data - Port One
Dim GDData() As Double
GDData = m_PDLARemoteControl.Results.YData(eMeasurementType_GD,
eODAPort_One)
'Get Gain Data - Port One
Dim GainData() As Double
GainData = m_PDLARemoteControl.Results.YData(eMeasurementType_Gain,
eODAPort_One)
' close session
m_PDLARemoteControl.Connectivity.Disconnect
Summary of Contents for 86038B
Page 1: ...Agilent 86038B Photonic Dispersion and Loss Analyzer User s Guide ...
Page 4: ...4 ...
Page 20: ...20 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 34: ...34 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition Figure 2 b Rear Panel ...
Page 78: ...78 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 92: ...92 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 202: ...202 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition End Sub ...
Page 348: ...348 Agilent 86038B Photonic Dispersion and Loss Analyzer Second Edition ...
Page 349: ......