Agilent Technologies MSO6102A Programmer's Reference Manual page 618

6000 series
Hide thumbs Also See for MSO6102A:
Table of Contents

Advertisement

9
Programming Examples
VisaComError:
End Sub
'
' Analyze
' -------------------------------------------------------------------
' In analyze, we will do the following:
'
'
'
'
'
' -------------------------------------------------------------------
Private Sub Analyze()
618
MsgBox "VISA COM Error:" + vbCrLf + Err.Description
- Save the system setup to a file and restore it.
- Save the waveform data to a file on the computer.
- Make single channel measurements.
- Save the oscilloscope display to a file that can be sent to a
printer.
On Error GoTo VisaComError
' SAVE_SYSTEM_SETUP - The :SYSTEM:SETUP? query returns a program
' message that contains the current state of the instrument.
' format is a definite-length binary block, for example,
'
#800002204<setup string><NL>
' where the setup string is 2204 bytes in length.
myScope.WriteString ":SYSTEM:SETUP?"
varQueryResult = myScope.ReadIEEEBlock(BinaryType_UI1)
CheckForInstrumentErrors
' Output setup string to a file:
Dim strPath As String
strPath = "c:\scope\config\setup.dat"
Close #1
' If #1 is open, close it.
' Open file for output.
Open strPath For Binary Access Write Lock Write As #1
Put #1, , varQueryResult
Close #1
' Close file.
' IMAGE_TRANSFER - In this example, we will query for the image data
' with ":DISPLAY:DATA?", read the data, and then save it to a file.
Dim byteData() As Byte
myScope.IO.Timeout = 15000
myScope.WriteString ":DISPLAY:DATA? BMP, SCREEN, COLOR"
byteData = myScope.ReadIEEEBlock(BinaryType_UI1)
' Output display data to a file:
strPath = "c:\scope\data\screen.bmp"
' Remove file if it exists.
If Len(Dir(strPath)) Then
Kill strPath
End If
Close #1
' If #1 is open, close it.
' Open file for output.
Open strPath For Binary Access Write Lock Write As #1
Put #1, , byteData
Close #1
' Close file.
myScope.IO.Timeout = 5000
' RESTORE_SYSTEM_SETUP - Read the setup string from a file and write
' After reading query results.
' Write data.
' Write data.
Agilent 6000 Series Oscilloscopes Programmer's Reference
Its

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents