Technical data

Table Of Contents
1294 Agilent Infiniium 9000 Series Oscilloscopes Programmer's Reference
38 Sample Programs
DataArray = File.ReadAllLines(strPath)
nBytesWritten = DataArray.Length
' Restore setup string.
myScope.SCPI.SYSTem.SETup.Command(DataArray)
Console.WriteLine("Setup bytes restored: {0}", nBytesWritten)
' Set the desired number of waveform points,
' and capture an acquisition.
myScope.SCPI.ACQuire.POINts.ANALog.Command(32000)
myScope.SCPI.DIGitize.Command(DBNull.Value)
End Sub
' Analyze the captured waveform.
' --------------------------------------------------------------
Private Shared Sub Analyze()
Dim strResultsArray As String()
' Results array.
Dim strResults As String
Dim fResult As Double
' Make measurements.
' -----------------------------------------------------------
myScope.SCPI.MEASure.SOURce.Command("CHANnel1", DBNull.Value)
myScope.SCPI.MEASure.SOURce.Query(strResultsArray)
Console.WriteLine("Measure source: {0}", strResultsArray(0))
myScope.SCPI.MEASure.FREQuency.Command("CHANnel1", DBNull.Value)
myScope.SCPI.MEASure.FREQuency.QuerySendValidOff("CHANnel1", _
DBNull.Value, fResult)
Console.WriteLine("Frequency: {0:F4} kHz", fResult / 1000)
' Use direct command/query when commands not in command set.
myScope.Transport.Command.Invoke(":MEASure:VAMPlitude CHANnel1")
myScope.Transport.Query.Invoke(":MEASure:VAMPlitude? CHANnel1", _
strResults)
Console.WriteLine("Vertical amplitude: {0} V", strResults)
' Download the screen image.
' -----------------------------------------------------------
' Get the screen data.
Dim byteResultsArray As Byte()
' Results array.
myScope.SCPI.DISPlay.DATA.Query("PNG", DBNull.Value, _
DBNull.Value, DBNull.Value, byteResultsArray)
Dim nLength As Integer
' Number of bytes returned from instrument.
nLength = byteResultsArray.Length
' Store the screen data to a file.
Dim strPath As String
strPath = "c:\scope\data\screen.png"
Dim fStream As FileStream = File.Open(strPath, FileMode.Create)
fStream.Write(byteResultsArray, 0, nLength)
fStream.Close()