Agilent Technologies InfiniiVision 7000A Series Programmer's Manual page 844

Table of Contents

Advertisement

12
Programming Examples
End Namespace
844
' If there is an error, print it.
If strInstrumentError.ToString() <> "+0,""No error""" _
& Chr(10) & "" Then
If bFirstError Then
' Print the command that caused the error.
Console.WriteLine("ERROR(s) for command '{0}': ", _
strCommand)
bFirstError = False
End If
Console.Write(strInstrumentError)
End If
Loop While strInstrumentError.ToString() <> "+0,""No error""" _
& Chr(10) & ""
End Sub
Private Sub OpenIo()
m_ResourceManager = New ResourceManagerClass()
m_IoObject = New FormattedIO488Class()
' Open the default VISA COM IO object.
Try
m_IoObject.IO = _
DirectCast(m_ResourceManager.Open(m_strVisaAddress, _
AccessMode.NO_LOCK, 0, ""), IMessage)
Catch e As Exception
Console.WriteLine("An error occurred: {0}", e.Message)
End Try
End Sub
Public Sub SetTimeoutSeconds(ByVal nSeconds As Integer)
m_IoObject.IO.Timeout = nSeconds * 1000
End Sub
Public Sub Close()
Try
m_IoObject.IO.Close()
Catch
End Try
Try
Marshal.ReleaseComObject(m_IoObject)
Catch
End Try
Try
Marshal.ReleaseComObject(m_ResourceManager)
Catch
End Try
End Sub
End Class
Agilent InfiniiVision 7000A Series Oscilloscopes Programmer's Guide

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents