Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 712

Hide thumbs Also See for InfiniiVision 5000 Series:
Table of Contents

Advertisement

12
Programming Examples
End Sub
'
' Analyze
' -------------------------------------------------------------------
' In analyze, we will do the following:
'
'
'
'
'
' -------------------------------------------------------------------
Private Sub Analyze()
712
' enough time for the data acquisition process to collect data,
' and the results may not be accurate.
' may be returned over the bus in this situation.
'
err = viVPrintf(vi, ":DIGITIZE CHAN1" + vbLf, 0)
- 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.
' Set up arrays for multiple parameter query returning an array
' with viVScanf/viVQueryf.
' of elements that the array can hold.
paramsArray(0) = VarPtr(retCount)
paramsArray(1) = VarPtr(byteArray(0))
' 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.
Dim lngSetupStringSize As Long
err = viVPrintf(vi, ":SYSTEM:SETUP?" + vbLf, 0)
retCount = ByteArraySize
' Unsigned integer bytes.
err = viVScanf(vi, "%#b\n" + vbLf, paramsArray(0))
lngSetupStringSize = retCount
' Output setup string to a file:
Dim strPath As String
Dim lngI As Long
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
For lngI = 0 To lngSetupStringSize - 1
Put #1, , byteArray(lngI)
Next lngI
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.
err = viVPrintf(vi, ":DISPLAY:DATA? BMP, SCREEN, COLOR" + vbLf, 0)
retCount = ByteArraySize
Set retCount to the maximum number
' Write data.
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
An error value of 9.9E+37
Its

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents