Example Code

Language Interface: 32-bit Microsoft Visual Basic

Code and Documents

Attachment

This is the GPIB language interface for creating 32-bit applications in the Windows environment using Microsoft Visual Basic versions 4.0, 6.0 and Visual Basic .NET 2005.

How to Use the 32-bit Microsoft Visual Basic Language Interface:

Overview

The 32-bit GPIB language interface for Microsoft Visual Basic versions 4.0 and 6.0 contains the following files:

NIGLOBAL.BAS: global module containing predefined constant declarations
VBIB-32.BAS: source file containing NI-488.2 routine and NI-488 function prototypes

II. Items to Include in Your GPIB Application

You must include VBIB-32.BAS and NIGLOBAL.BAS in your application project file. VBIB-32.BAS contains the NI-488.2 routine and NI-488 function prototypes for interfacing with the dynamic link library GPIB-32.DLL. NIGLOBAL.BAS contains GPIB-specific variable declarations and constant definitions.

[ Note: The required key strokes and menu bar selections needed in order to add files to a project vary with different versions of that particular compiler. For information about how to add files, please refer to the manuals and online help that came with your version of the compiler. ]

III. Compiling, Linking, and Running from the Microsoft Visual Basic Environment

Within the environment, you can compile, link, and run your application.

[ Note: The required key strokes and menu bar selections needed in order to create, compile, and link a project vary with different versions of that particular compiler. For information about how to add files, compile, link, and run a project, please refer to the manuals and online help that came with your version of the compiler. ]

IV. More information about Visual Basic Windows Programming

For more information about how to create Graphical User Interface (GUI) Windows application using Visual Basic, please refer to the following:
The Visual Basic manuals and online help that came with your compiler

For a starting point on how to make a Visual Basic program, please refer to the "Visual Basic for Dummies" set of books by Wallace Wang

The sample programs included with the language interface demonstrate how to make GPIB calls from within a Visual Basic application

If you are using Visual Basic 4.0, then download the "Vbasic4.zip" file (in the example.zip file, below). This file contains the declaration file NIGLOBAL.BAS, the language interface file VBIB-32.BAS, the GpibNotify OLE Control (Version 1.1), and some sample programs for Visual Basic 4.0.

If you are using Visual Basic 6.0, then download the "Msvb.exe" file (in the example.zip file, below). This file contains the declaration file NIGLOBAL.BAS, the language interface file VBIB-32.BAS, and some sample programs for Visual Basic 6.0.

If you are using Visual Basic .NET 2005 for examples download the simple read and write file and notify file.

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors