Programming Examples
12
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide
881
' as it will ensure that sufficient data is available for
' measurement.
Keep in mind when the oscilloscope is running,
' communication with the computer interrupts data acquisition.
' Setting up the oscilloscope over the bus causes the data
' buffers to be cleared and internal hardware to be
' reconfigured.
' If a measurement is immediately requested there may not have
' been enough time for the data acquisition process to collect
' data and the results may not be accurate.
An error value of
' 9.9E+37 may be returned over the bus in this situation.
'
oscp.DoCommand(":DIGitize CHANnel1")
End Sub
' Analyze()
' --------------------------------------------------------------
' In this example we will do the following:
'
- Save the system setup to a file for restoration at a later
'
time.
'
- Save the oscilloscope display to a file which can be
'
printed.
'
- Make single channel measurements.
Private Shared Sub Analyze()
' Results array.
Dim ResultsArray As Byte()
' Number of bytes returned from instrument.
Dim nLength 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.
nLength = oscp.DoQueryIEEEBlock(":SYSTem:SETup?", ResultsArray)
Console.WriteLine("Read oscilloscope setup ({0} bytes).", _
nLength)
' Write setup string to file.
File.WriteAllBytes("c:\scope\config\setup.dat", ResultsArray)
Console.WriteLine("Wrote setup string ({0} bytes) to file.", _
nLength)
' RESTORE_SYSTEM_SETUP - Uploads a previously saved setup
' string to the oscilloscope.
Dim DataArray As Byte()
Dim nBytesWritten As Integer
Summary of Contents for InfiniiVision 7000A Series
Page 1: ...Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide...
Page 34: ...34 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 1 What s New...
Page 44: ...44 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 2 Setting Up...
Page 58: ...58 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 3 Getting Started...
Page 750: ...750 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide 8 Error Messages...
Page 922: ...922 Agilent InfiniiVision 7000A Series Oscilloscopes Programmer s Guide Index...