Agilent Technologies 86038A User Manual page 160

Optical dispersion analyzer
Table of Contents

Advertisement

Remote Operation
160
Fill out the function so it looks like:
If eTriggerMode = enumAcquisitionMode_eMeasurement Then
If progress = enumStatus_COMPLETE Then
sendDataToFile ("c:\mydata.txt")
End If
End If
5 Add the sendDataToFile function. This is a very simple implementation using
text streams. Insert this function immediately after
odaClient_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 = odaClient.Results.YData _
(eMeasurementType_Gain,eODAPort_One)
npoin = UBound(gainData) - LBound(gainData)+1
xStart = odaClient.Results.xStart(eMeasurementType_Gain)
xStop = odaClient.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 ODA 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
Example 1: Simple Application for Controlling the ODA
Agilent 86038A Optical Dispersion Analyzer, Third Edition

Advertisement

Table of Contents
loading

Table of Contents