Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 641

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

Advertisement

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
' Unsigned integer bytes.
err = viVScanf(vi, "%#b\n" + vbLf, paramsArray(0))
' 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
For lngI = 0 To retCount - 1
Put #1, , byteArray(lngI)
Next lngI
Close #1
' Close file.
' RESTORE_SYSTEM_SETUP - Read the setup string from a file and write
' it back to the oscilloscope.
strPath = "c:\scope\config\setup.dat"
Open strPath For Binary Access Read As #1
Get #1, , byteArray
Close #1
' Close file.
' Write learn string back to oscilloscope using ":SYSTEM:SETUP"
' command:
retCount = lngSetupStringSize
err = viVPrintf(vi, ":SYSTEM:SETUP %#b" + vbLf, paramsArray(0))
' MEASURE - The commands in the MEASURE subsystem are used to make
' measurements on displayed waveforms.
' Source to measure
err = viVPrintf(vi, ":MEASURE:SOURCE CHANNEL1" + vbLf, 0)
' Query for frequency.
err = viVPrintf(vi, ":MEASURE:FREQUENCY?" + vbLf, 0)
' Read frequency.
err = viVScanf(vi, "%lf" + vbLf, VarPtr(dblQueryResult))
MsgBox "Frequency:" + vbCrLf + _
FormatNumber(dblQueryResult / 1000, 4) + " kHz"
' Query for duty cycle.
err = viVPrintf(vi, ":MEASURE:DUTYCYCLE?" + vbLf, 0)
' Read duty cycle.
err = viVScanf(vi, "%lf" + vbLf, VarPtr(dblQueryResult))
MsgBox "Duty cycle:" + vbCrLf + FormatNumber(dblQueryResult, 3) + "%"
' Query for risetime.
err = viVPrintf(vi, ":MEASURE:RISETIME?" + vbLf, 0)
' Read risetime.
err = viVScanf(vi, "%lf" + vbLf, VarPtr(dblQueryResult))
MsgBox "Risetime:" + vbCrLf + _
FormatNumber(dblQueryResult * 1000000, 4) + " us"
' Query for Peak to Peak voltage.
err = viVPrintf(vi, ":MEASURE:VPP?" + vbLf, 0)
' Write data.
' Read data.
Programming Examples
' Open file for input.
12
641

Advertisement

Table of Contents
loading

Table of Contents