838
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
12
Programming Examples
Dim nBytes As Integer
' SAVE_SYSTEM_SETUP - The :SYSTem:SETup? query returns a
' program message that contains the current state of the
' instrument.
Its format is a definite-length binary block,
' for example,
'
#800002204<setup string><NL>
' where the setup string is 2204 bytes in length.
Console.WriteLine("Saving oscilloscope setup to " + _
"c:\scope\config\setup.dat")
If File.Exists("c:\scope\config\setup.dat") Then
File.Delete("c:\scope\config\setup.dat")
End If
' Query and read setup string.
ResultsArray = myScope.DoQueryIEEEBlock(":SYSTem:SETup?")
nBytes = ResultsArray.Length
Console.WriteLine("Read oscilloscope setup ({0} bytes).", nBytes)
' Write setup string to file.
File.WriteAllBytes("c:\scope\config\setup.dat", ResultsArray)
Console.WriteLine("Wrote setup string ({0} bytes) to file.", _
nBytes)
' RESTORE_SYSTEM_SETUP - Uploads a previously saved setup
' string to the oscilloscope.
Dim DataArray As Byte()
' Read setup string from file.
DataArray = File.ReadAllBytes("c:\scope\config\setup.dat")
Console.WriteLine("Read setup string ({0} bytes) from file.", _
DataArray.Length)
' Restore setup string.
myScope.DoCommandIEEEBlock(":SYSTem:SETup", DataArray)
Console.WriteLine("Restored setup string.")
' IMAGE_TRANSFER - In this example, we query for the screen
' data with the ":DISPLAY:DATA?" query.
The .png format
' data is saved to a file in the local file system.
Console.WriteLine("Transferring screen image to " + _
"c:\scope\data\screen.png")
If File.Exists("c:\scope\data\screen.png") Then
File.Delete("c:\scope\data\screen.png")
End If
' Increase I/O timeout to fifteen seconds.
myScope.SetTimeoutSeconds(15)
' Get the screen data in PNG format.
ResultsArray = _
myScope.DoQueryIEEEBlock(":DISPlay:DATA? PNG, SCReen, COLor")
nBytes = ResultsArray.Length
Console.WriteLine("Read screen image ({0} bytes).", nBytes)
' Store the screen data in a file.
File.WriteAllBytes("c:\scope\data\screen.png", ResultsArray)
Содержание InfiniiVision 7000A Series
Страница 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Страница 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Страница 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Страница 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Страница 652: ...652 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 5 Commands by Subsystem...
Страница 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Страница 784: ...784 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 10 Synchronizing Acquisitions...
Страница 810: ...810 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 11 More About Oscilloscope Commands...
Страница 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...