EasyManuals Logo

Agilent Technologies InfiniiVision 5000 Series Programmer's Guide

Agilent Technologies InfiniiVision 5000 Series
788 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #773 background imageLoading...
Page #773 background image
Programming Examples 12
Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide 773
' ":WAVEFORM:POINTS" command. You may then read that number
' of bytes from the oscilloscope; then, read the following NL
' character to terminate the query.
' Read waveform data.
ResultsArray = myScope.DoQueryIEEEBlock(":WAVeform:DATA?")
nBytes = ResultsArray.Length
Console.WriteLine("Read waveform data ({0} bytes).", nBytes)
' Make some calculations from the preamble data.
Dim fVdiv As Double = 32 * fYincrement
Dim fOffset As Double = fYorigin
Dim fSdiv As Double = fPoints * fXincrement / 10
Dim fDelay As Double = (fPoints / 2) * fXincrement + fXorigin
' Print them out...
Console.WriteLine("Scope Settings for Channel 1:")
Console.WriteLine("Volts per Division = {0:f}", fVdiv)
Console.WriteLine("Offset = {0:f}", fOffset)
Console.WriteLine("Seconds per Division = {0:e}", fSdiv)
Console.WriteLine("Delay = {0:e}", fDelay)
' Print the waveform voltage at selected points:
Dim i As Integer = 0
While i < nBytes
Console.WriteLine("Data point {0:d} = {1:f6} Volts at " + _
"{2:f10} Seconds", i, _
(CSng(ResultsArray(i)) - fYreference) * fYincrement + _
fYorigin, (CSng(i) - fXreference) * fXincrement + fXorigin)
i = i + (nBytes / 20)
End While
' SAVE_WAVE_DATA - saves the waveform data to a CSV format
' file named "waveform.csv".
If File.Exists("c:\scope\data\waveform.csv") Then
File.Delete("c:\scope\data\waveform.csv")
End If
Dim writer As StreamWriter = _
File.CreateText("c:\scope\data\waveform.csv")
For index As Integer = 0 To nBytes - 1
writer.WriteLine("{0:E}, {1:f6}", _
(CSng(index) - fXreference) * fXincrement + fXorigin, _
(CSng(ResultsArray(index)) - fYreference) * fYincrement _
+ fYorigin)
Next
writer.Close()
Console.WriteLine("Waveform data ({0} points) written to"+_
"c:\scope\data\waveform.csv.", nBytes)
End Sub
End Class
Class VisaComInstrument
Private m_ResourceManager As ResourceManagerClass
Private m_IoObject As FormattedIO488Class
Private m_strVisaAddress As String

Table of Contents

Other manuals for Agilent Technologies InfiniiVision 5000 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies InfiniiVision 5000 Series and is the answer not in the manual?

Agilent Technologies InfiniiVision 5000 Series Specifications

General IconGeneral
BrandAgilent Technologies
ModelInfiniiVision 5000 Series
CategoryTest Equipment
LanguageEnglish

Related product manuals