Agilent Technologies InfiniiVision 5000 Series Programmer's Manual page 739

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

Advertisement

Agilent InfiniiVision 5000 Series Oscilloscopes Programmer's Guide
' 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 999
writer.WriteLine("{0:E}, {1:f6}", _
(CSng(index) - fXreference) * fXincrement + fXorigin, _
(CSng(ResultsArray(index)) - fYreference) * fYincrement _
+ fYorigin)
Next
writer.Close()
End Sub
End Class
Class VisaInstrument
Private m_nResourceManager As Integer
Private m_nSession As Integer
Private m_strVisaAddress As String
' Constructor.
Public Sub New(ByVal strVisaAddress As String)
' Save VISA address in member variable.
m_strVisaAddress = strVisaAddress
' Open the default VISA resource manager.
OpenResourceManager()
' Open a VISA resource session.
OpenSession()
' Clear the interface.
Dim nViStatus As Integer
nViStatus = visa32.viClear(m_nSession)
End Sub
Public Sub DoCommand(ByVal strCommand As String)
' Send the command.
VisaSendCommandOrQuery(strCommand)
' Check for instrument errors (another command and result).
CheckForInstrumentErrors(strCommand)
End Sub
Public Function DoCommandIEEEBlock(ByVal strCommand As String, _
ByVal DataArray As Byte()) As Integer
' Send the command to the device.
Dim strCommandAndLength As String
Dim nViStatus As Integer
Dim nLength As Integer
Dim nBytesWritten As Integer
nLength = DataArray.Length
Programming Examples
739
12

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents