Agilent Technologies 86038B User Manual page 182

Photonic dispersion and loss analyzer
Table of Contents

Advertisement

182
This function checks the enumAcquisitionMode to determine
the type of trigger event (that is, measurement,
normalization, and so on) and then checks the enumStatus to
see if the measurement is finished, indicating data is
available. If so, call sendDataToFile().
In the source code window, select pdlaClient in the Object
Selector in the upper left corner of the window, then select
TriggerProgress in the Method Selector in the upper right
corner. This takes you to the sub pdlaClient_TriggerProgress,
with two pass parameters already declared. Progress is an
enumerated type which tells you whether you are at the
begin or end, and eTriggerMode, which tells you whether the
current activity is a measurement or a normalization.
5 Click on the next line after the sub declaration, and type:
If eTriggerMode =
When you type the '=', the Visual Basic editor will Intellisense
all the possible values of the enumeration, and present you a
list. In this case we want eMeasurement. Intellisense makes
dealing with events and enumerated types much easier in
visual basic.
Fill out the function so it looks like:
' Only do something if this is a measurement
If eTriggerMode =
Agilent.LWD.Ag86038x.InstrumentObjects.ODACommon.enumAcquisitionMode.eMea
surement Then
' Only do something if the measurement is complete
If progress =
Agilent.LWD.Ag86038x.InstrumentObjects.ODACommon.enumStatus.COMPLETE Then
' Write the data to disk
sendDataToFile("c:\mydata.txt")
End If
End If
6 Add the sendDataToFile function. This is a very simple implementation using
text streams. Insert this function immediately after
pdlaClient_TriggerProgress:
Private Sub sendDataToFile(ByVal fileName As String)
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 _
(Agilent.LWD.Ag86038x.InstrumentObjects.ODACommon.eMeasurementType.Gain, _
Agilent 86038B Photonic Dispersion and Loss Analyzer, Second Edition

Advertisement

Table of Contents
loading

Table of Contents