Programming Examples
41
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
1241
Dim fXreference As Double = fResultsArray(6)
Console.WriteLine("Waveform X reference: {0:e}", fXreference)
Dim fYincrement As Double = fResultsArray(7)
Console.WriteLine("Waveform Y increment: {0:e}", fYincrement)
Dim fYorigin As Double = fResultsArray(8)
Console.WriteLine("Waveform Y origin: {0:e}", fYorigin)
Dim fYreference As Double = fResultsArray(9)
Console.WriteLine("Waveform Y reference: {0:e}", fYreference)
' Get the waveform data.
ResultsArray = myScope.DoQueryIEEEBlock(":WAVeform:DATA?")
nLength = ResultsArray.Length
Console.WriteLine("Number of data values: {0}", nLength)
' Set up output file:
strPath = "c:\scope\data\waveform_data.csv"
If File.Exists(strPath) Then
File.Delete(strPath)
End If
' Open file for output.
Dim writer As StreamWriter = File.CreateText(strPath)
' Output waveform data in CSV format.
For index As Integer = 0 To nLength - 1
' Write time value, voltage value.
writer.WriteLine("{0:f9}, {1:f6}", _
fX (CSng(index) * fXincrement), _
((CSng(ResultsArray(index)) - fYreference) _
* fYincrement) + fYorigin)
Next
' Close output file.
writer.Close()
Console.WriteLine("Waveform format BYTE data written to {0}", _
strPath)
End Sub
End Class
Class VisaComInstrument
Private m_ResourceManager As ResourceManagerClass
Private m_IoObject As FormattedIO488Class
Private m_strVisaAddress As String
' Constructor.
Public Sub New(ByVal strVisaAddress As String)
' Save VISA addres in member variable.
m_strVisaAddress = strVisaAddress
' Open the default VISA COM IO object.
Summary of Contents for InfiniiVision 4000 X-Series
Page 1: ...s1 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 32: ...32 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 52: ...52 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 2 Setting Up ...
Page 66: ...66 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 3 Getting Started ...
Page 242: ...242 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 7 ACQuire Commands ...
Page 252: ...252 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands ...
Page 300: ...300 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 12 DEMO Commands ...
Page 330: ...330 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 15 DVM Commands ...
Page 386: ...386 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 18 HARDcopy Commands ...
Page 484: ...484 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 21 MEASure Commands ...
Page 1098: ...1098 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 34 WGEN w Commands ...
Page 1174: ...1174 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 37 Error Messages ...
Page 1352: ...1352 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide Index ...