HP (Hewlett-Packard) Drive Network Card User Manual


 
34
Chapter 3
Your final program should contain the code below:
using System;
using System.Collections.Generic;
using System.Text;
using Agilent.Agilent34401.Interop;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Agilent34401Class dmm = new
Agilent34401Class();
dmm.Initialize("GPIB::23", false, true, "sim-
ulate=true");
dmm.DCVoltage.Configure(1.5, 0.001);
dmm.Trigger.Delay = 0.01;
double reading;
reading = dmm.Measurement.Read(1000);
Console.WriteLine("The measurement is {0}",
reading);
Console.ReadLine();
dmm.Close();
}
}
}
Build and Run the Application
Build your application and run it to verify it works properly.
1 From the Build menu, click the name of your Console Application.
2 From the Debug menu, click Start Debugging.
Tips
The code for a Visual Basic console application in Visual Studio 2005 is almost
identical to the C# application:
Option Explicit On