Agilent Technologies Infiniium 90000 Series Programmer's Manual page 1124

Oscilloscopes
Hide thumbs Also See for Infiniium 90000 Series:
Table of Contents

Advertisement

38
Sample Programs
1124
' Set the waveform source.
DoCommand ":WAVeform:SOURce CHANnel1"
Debug.Print "Waveform source: " + _
DoQueryString(":WAVeform:SOURce?")
' Choose the format of the data returned:
DoCommand ":WAVeform:FORMat BYTE"
Debug.Print "Waveform format: " + _
DoQueryString(":WAVeform:FORMat?")
' Display the waveform settings:
Dim dblXIncrement As Double
Dim dblXOrigin As Double
Dim dblYIncrement As Double
Dim dblYOrigin As Double
dblXIncrement = DoQueryNumber(":WAVeform:XINCrement?")
Debug.Print "Waveform X increment: " + _
Format(dblXIncrement, "Scientific")
dblXOrigin = DoQueryNumber(":WAVeform:XORigin?")
Debug.Print "Waveform X origin: " + _
Format(dblXOrigin, "Scientific")
dblYIncrement = DoQueryNumber(":WAVeform:YINCrement?")
Debug.Print "Waveform Y increment: " + _
Format(dblYIncrement, "Scientific")
dblYOrigin = DoQueryNumber(":WAVeform:YORigin?")
Debug.Print "Waveform Y origin: " + _
FormatNumber(dblYOrigin, 0)
' Get the waveform data
DoCommand ":WAVeform:STReaming OFF"
Dim lngNumBytes As Long
lngNumBytes = DoQueryIEEEBlock_Bytes(":WAVeform:DATA?")
Debug.Print "Number of data values: " + _
CStr(lngNumBytes - CInt(Chr(byteArray(1))) - 2)
' 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
Dim byteUnsigned As Byte
' Skip past header.
For lngI = CInt(Chr(byteArray(1))) + 2 To lngNumBytes - 2
byteUnsigned = byteArray(lngI)
' Oscilloscope BYTE format sends signed bytes. VBA Byte is
' interpreted as unsigned, so convert the bits to signed value.
lngDataValue = byteUnsigned - ((byteUnsigned And &H80) * 2)
' Write time value, voltage value.
Agilent Infiniium 90000 Series Oscilloscopes Programmer's Reference

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents