Agilent Technologies InfiniiVision 2000 X-Series Programmer's Manual page 866

Oscilloscopes
Hide thumbs Also See for InfiniiVision 2000 X-Series:
Table of Contents

Advertisement

38
Programming Examples
866
' Read setup string from file.
strPath = "c:\scope\config\setup.stp"
DataArray = File.ReadAllBytes(strPath)
' Restore setup string.
nBytesWritten = myScope.DoCommandIEEEBlock(":SYSTem:SETup", _
DataArray)
Console.WriteLine("Setup bytes restored: {0}", nBytesWritten)
' Capture an acquisition using :DIGitize.
myScope.DoCommand(":DIGitize CHANnel1")
End Sub
'
' Analyze the captured waveform.
' --------------------------------------------------------------
Private Shared Sub Analyze()
Dim fResult As Double
Dim ResultsArray As Byte()
Dim nLength As Integer
Dim strPath As String
' Make a couple of measurements.
' ------------------------------------------------------------
myScope.DoCommand(":MEASure:SOURce CHANnel1")
Console.WriteLine("Measure source: {0}", _
myScope.DoQueryString(":MEASure:SOURce?"))
myScope.DoCommand(":MEASure:FREQuency")
fResult = myScope.DoQueryNumber(":MEASure:FREQuency?")
Console.WriteLine("Frequency: {0:F4} kHz", fResult / 1000)
myScope.DoCommand(":MEASure:VAMPlitude")
fResult = myScope.DoQueryNumber(":MEASure:VAMPlitude?")
Console.WriteLine("Vertial amplitude: {0:F2} V", fResult)
' Download the screen image.
' ------------------------------------------------------------
myScope.DoCommand(":HARDcopy:INKSaver OFF")
' Get the screen data.
nLength = myScope.DoQueryIEEEBlock(":DISPlay:DATA? PNG, COLor", _
ResultsArray)
' Store the screen data to a file.
strPath = "c:\scope\data\screen.png"
Dim fStream As FileStream
fStream = File.Open(strPath, FileMode.Create)
fStream.Write(ResultsArray, 0, nLength)
fStream.Close()
Console.WriteLine("Screen image ({0} bytes) written to {1}", _
nLength, strPath)
' Download waveform data.
Agilent InfiniiVision 2000 X-Series Oscilloscopes Programmer's Guide
' Results array.
' Number of bytes returned from inst.

Advertisement

Table of Contents
loading

Table of Contents