HP (Hewlett-Packard) Drive Network Card User Manual


 
Using IVI with Visual C# and Visual Basic
35
Imports Agilent.Agilent34401.Interop
Module Module1
Sub Main()
Dim dmm As New Agilent34401
dmm.Initialize("GPIB::23", False, True,
"simulate=true")
dmm.Function =
Agilent34401FunctionEnum.Agilent34401FunctionDCVolts
dmm.DCVoltage.Configure(1.5, 0.001)
dmm.Trigger.Delay = 0.01
Dim reading As New Double
reading = dmm.Measurement.Read(1000)
dmm.Close()
Console.WriteLine(“The reading is {0}”, reading)
Console.ReadLine()
End Sub
End Module
The main differences include the following:
To use Visual Basic, select Visual Basic in Project Types.
To enforce type checking, insert a line at the start of the code. Type
Option Explicit On
To call the DCVolts function you need to insert a line of code. Type
dmm.Function =
Agilent34401FunctionEnum.Agilent34401FunctionDCVolts
To dimension a variable for the instrument and reading, use
Dim dmm
and
Dim
reading
.
Further Information
Learn more about Visual C# at http://msdn.microsoft.com/vsharp/.
Learn more about Visual Basic at http://msdn.microsoft.com/vbasic/.
Microsoft® and Visual Studio® are registered trademarks of Microsoft Corporation
in the United States and/or other countries.