HP Drive manual Tips, Agilent34401Class dmm = new Agilent34401Class

Models: Drive

1 114
Download 114 pages 61.75 Kb
Page 34
Image 34

34

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.

1From the Build menu, click the name of your Console Application.

2From 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

Chapter 3

Page 34
Image 34
HP Drive manual Tips, Agilent34401Class dmm = new Agilent34401Class