Agilent Technologies InfiniiVision 7000A Series Programmer's Manual page 858

Table of Contents

Advertisement

12
Programming Examples
' Analyze the captured waveform.
' -------------------------------------------------------------------
Private Sub Analyze()
858
' Make a couple of measurements.
' -----------------------------------------------------------------
DoCommand ":MEASure:SOURce CHANnel1"
Debug.Print "Measure source: " + _
DoQueryString(":MEASure:SOURce?")
DoCommand ":MEASure:VAMPlitude"
dblQueryResult = DoQueryNumber(":MEASure:VAMPlitude?")
MsgBox "Vertial amplitude:" + vbCrLf + _
FormatNumber(dblQueryResult, 4) + " V"
DoCommand ":MEASure:FREQuency"
dblQueryResult = DoQueryNumber(":MEASure:FREQuency?")
MsgBox "Frequency:" + vbCrLf + _
FormatNumber(dblQueryResult / 1000, 4) + " kHz"
' Download the screen image.
' -----------------------------------------------------------------
' Get screen image.
Dim lngBlockSize As Long
lngBlockSize = _
DoQueryIEEEBlock_Bytes(":DISPlay:DATA? PNG, SCREEN, COLOR")
Debug.Print "Screen image bytes: " + CStr(lngBlockSize)
' Save screen image to a file:
Dim strPath As String
strPath = "c:\scope\data\screen.png"
If Len(Dir(strPath)) Then
Kill strPath
' Remove file if it exists.
End If
Dim hFile As Long
hFile = FreeFile
Open strPath For Binary Access Write Lock Write As hFile
Dim lngI As Long
For lngI = 0 To lngBlockSize - 1
Put hFile, , byteArray(lngI)
Next lngI
Close hFile
' Close file.
MsgBox "Screen image written to " + strPath
' Download waveform data.
' -----------------------------------------------------------------
' Set the waveform points mode.
DoCommand ":WAVeform:POINts:MODE RAW"
Debug.Print "Waveform points mode: " + _
DoQueryString(":WAVeform:POINts:MODE?")
' Set the desired number of waveform points.
DoCommand ":WAVeform:POINts 1000"
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
' Write data.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents