Example Code

Archived: Language Interface: 16-bit Microsoft Professional BASIC for DOS

Code and Documents

Attachment

Overview


This document has been archived and is no longer updated by National Instruments.

This is the GPIB language interface for Microsoft Professional BASIC (version 7), a DOS programming environment for creating 16-bit applications. Download the Basic7.zip file (in the example.zip file, below). This file contains the declaration file MBDECL.BAS, the language interface file MBIB.OBJ, and some sample programs.


How to Use the Microsoft Professional BASIC Language Interface:

I. Overview

The 16-bit GPIB language interface for Microsoft Professional BASIC contains the following files:

MBDECL.BAS: Microsoft BASIC program declarations
MBIB.OBJ: Microsoft BASIC language interface object module

If you have the GPIB Software for DOS, the Professional BASIC language interface and the sample applications are located in the directory called \BASIC7 (where is where the GPIB software for DOS is installed).


II. Items to Include in Your GPIB Application

You must include the following line at the beginning of your application:

'$INCLUDE: 'MBDECL.BAS'

Next you need to link the mbib.obj file to your application.


III.A. Compiling, Linking, and Running from the Professional BASIC Environment

Before you can run an application, called yourprog, from within the Professional BASIC interactive environment, follow the steps listed below:

1. From the DOS command line, create an object module library called MBIB.LIB, by typing in the following:

LIB MBIB.LIB + MBIB.OBJ;

From the DOS command line, to create a QuickLibrary called MBIB.QLB that is linked with the MBIB.OBJ language interface, type in:

LINK /Q MBIB.OBJ,,,QBXQLB.LIB;

[NOTE: Please remember to include the three commas between MBIB.OBJ and QBXQLB.LIB.]

2. To invoke the BASIC environment where you can run an application called yourprog, type the following on the DOS command line:

QBX YOURPROG /L MBIB.QLB


III.B. Compiling, Linking, and Running from the DOS Command Line

To run an application, called yourprog, from the DOS command line, follow the steps listed below:

1. To compile the BASIC application called yourprog, type in:

BC YOURPROG;

2. To link the BASIC application, called yourprog, with the MBIB.OBJ language interface, enter the following:

LINK YOURPROG MBIB;

3. To run the application, called yourprog, from the command line, type in:

YOURPROG

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

Contributors