Agilent 4155C/4156C VXIplug&play Driver User’s Guide, Edition 4 4-3
Programming Examples for Visual Basic .NET Users
Programming Basics
Programming Basics
This section provides the basic information for programming using the Agilent
4155/4156 VXIplug&play driver.
• “To Create Your Project Template”
• “To Create Measurement Program”
NOTE To Start Program
If you create the measurement program by modifying the example code shown in
Table 4-1, the program can be run by clicking the Run button on the Visual Basic
main window. After that, a message box will appear. Then click OK to continue.
To Create Your Project Template
This section explains how to create a project template using Microsoft Visual Basic
.NET. Before starting programming, create your project template, and keep it as
your reference. It will remove the conventional task in the future programming.
Step 1. Connect instrument (e.g. Agilent 4155/4156) to computer via GPIB.
Step 2. Launch Visual Basic .NET and create a new project. The project type must be
Agilent T&M Toolkit Projects.
Follow the Agilent T&M Toolkit New Project Wizard to create the project. Then
select the following libraries to be imported additionally.
• Agilent.TMFramework.InstrumentDriverInterop
• Agilent.TMFramework.InstrumentDriverInterop.Design
Step 3. Click T&M Toolkit > Instrument Explorer to open Agilent Instrument Explorer. On
the explorer, click Find Instrument icon to detect the instrument automatically.
Step 4. Click T&M Toolkit > Driver Wrapper Wizard to open Agilent Driver Wrapper
Wizard. And follow the wizard to enable your desired VXIplug&play driver
(e.g. HP4156B - VXIplug&play).
Step 5. Right-click on the instrument icon (e.g. HP 4156C (:17) icon) in the Agilent
Instrument Explorer, and click on Add Instrument Session to open Agilent
Instrument Session Wizard. And follow the wizard to add the VXIplug&play
session for the instrument (e.g. HP4156C).