Programming Examples 12
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide 695
' Set up output file:
strPath = "c:\scope\data\waveform_data.csv"
' Open file for output.
Open strPath For Output Access Write Lock Write As hFile
' Output waveform data in CSV format.
Dim lngDataValue As Long
For lngI = 10 To lngNumBytes - 2 ' Skip past 10-byte header.
lngDataValue = CLng(byteArray(lngI))
' Write time value, voltage value.
Print #hFile, _
Format(dblXOrigin + lngI * dblXIncrement, "Scientific") + _
", " + _
FormatNumber((lngDataValue - dblYReference) * dblYIncrement + _
dblYOrigin)
Next lngI
' Close output file.
Close hFile ' Close file.
MsgBox "Waveform format BYTE data written to"+_
"c:\scope\data\waveform_data.csv."
Exit Sub
ErrorHandler:
MsgBox "*** Error :"+Error, vbExclamation
End
End Sub
Private Sub DoCommand(command As String)
On Error GoTo ErrorHandler
Call ivprintf(id, command + vbLf)
CheckForInstrumentErrors command
Exit Sub
ErrorHandler:
MsgBox "*** Error :"+Error, vbExclamation
End
End Sub
Private Function DoCommandIEEEBlock(command As String, _
lngBlockSize As Long)
On Error GoTo ErrorHandler
' Send command part.