Agilent Technologies InfiniiVision 3000 Programmer's Manual page 1143

X-series
Hide thumbs Also See for InfiniiVision 3000:
Table of Contents

Advertisement

Agilent InfiniiVision 3000 X-Series Oscilloscopes Programmer's Guide
' Output setup string to a file:
Dim strPath As String
strPath = "c:\scope\config\setup.dat"
If Len(Dir(strPath)) Then
Kill strPath
' Remove file if it exists.
End If
' Open file for output.
Dim hFile As Long
hFile = FreeFile
Open strPath For Binary Access Write Lock Write As hFile
Dim lngI As Long
For lngI = 0 To lngSetupStringSize - 1
Put hFile, , byteArray(lngI)
Next lngI
Close hFile
' Close file.
' Change settings with individual commands:
' -----------------------------------------------------------------
' Set vertical scale and offset.
DoCommand ":CHANnel1:SCALe 0.05"
Debug.Print "Channel 1 vertical scale: " + _
DoQueryString(":CHANnel1:SCALe?")
DoCommand ":CHANnel1:OFFSet -1.5"
Debug.Print "Channel 1 vertical offset: " + _
DoQueryString(":CHANnel1:OFFSet?")
' Set horizontal scale and position.
DoCommand ":TIMebase:SCALe 0.0002"
Debug.Print "Timebase scale: " + _
DoQueryString(":TIMebase:SCALe?")
DoCommand ":TIMebase:POSition 0.0"
Debug.Print "Timebase position: " + _
DoQueryString(":TIMebase:POSition?")
' Set the acquisition type (NORMal, PEAK, AVERage, or HRESolution).
DoCommand ":ACQuire:TYPE NORMal"
Debug.Print "Acquire type: " + _
DoQueryString(":ACQuire:TYPE?")
' Or, configure by loading a previously saved setup.
' -----------------------------------------------------------------
strPath = "c:\scope\config\setup.dat"
Open strPath For Binary Access Read As hFile
Dim lngSetupFileSize As Long
lngSetupFileSize = LOF(hFile)
Get hFile, , byteArray
Close hFile
' Close file.
' Write learn string back to oscilloscope using ":SYSTem:SETup"
' command:
Dim lngRestored As Long
lngRestored = DoCommandIEEEBlock(":SYSTem:SETup", lngSetupFileSize)
Debug.Print "Setup bytes restored: " + CStr(lngRestored)
' Write data.
' Length of file.
' Read data.
Programming Examples
' Open file for input.
39
1143

Advertisement

Table of Contents
loading

Table of Contents