Last Updated: August 29, 2007
Computers communicate with the test set by sending and receiving messages over a remote interface. Once you have opened a connection to the test set over the remote interface, programming instructions normally appear as ASCII character strings embedded inside write statements of the programing language, in this case Visual Basic .NET. Read statements are used to read query responses from the test set.
For example, when using the Agilent VISA COM library in Visual Basic .NET (after opening the connection to the test set using the ResourceManager object’s Open method), the FormattedIO488 object’s WriteString, WriteNumber, WriteList, or WriteIEEEBlock methods are used for sending commands and queries. After a query is sent, the response is read using the ReadString, ReadNumber, ReadList, or ReadIEEEBlock methods.
The following Visual Basic .NET statements open the connection and send a command that changes the test set’s display brightness.
Option Explicit On
Option Strict On
Imports Ivi.Visa.Interop
Dim ResManager As New ResourceManager
Dim TestSet As New FormattedIO488
' Open the connection to the test set. Get the "VISA Address" from the
' Agilent Connection Expert (installed with Agilent IO Libraries Suite).
' For example, the "VISA Address" used in this code is "GPIB0::14::INSTR".
TestSet.IO = CType(ResManager.Open("GPIB0::14::INSTR"), IMessage)
' Send a command.
TestSet.WriteString("DISPlay:BRIGhtness MEDium")
The “DISPlay:BRIGHTness MEDium” command used in the above example adjusts the brightness of the test set's LCD display.
For more information on the conventions used in the programming examples click here.