Calling Syntax; Steps For Writing An Ni-488.2 Program; Step 1 - Preparation - National Instruments GPIB-PCII Getting Started

Hide thumbs Also See for GPIB-PCII:
Table of Contents

Advertisement

Writing an Advanced Program Using NI-488.2 Routines

Calling Syntax

The calling syntax for NI-488.2 routines varies slightly according to the
language used. For the sake of brevity, the syntax shown in this manual is for
Microsoft QuickBASIC and C. Syntax for other languages is described in the
NI-488.2 MS-DOS Software Reference Manual, and in associated language
interface manuals.

Steps for Writing an NI-488.2 Program

This section demonstrates how to use the NI-488.2 routines. An in-depth
example program written in Microsoft QuickBASIC is developed step-by-step.
The example program configures a Fluke model 45 digital multimeter, reads
back 10 voltage measurements, and computes the average of these
measurements. Error detection and reporting is handled explicitly in the
program as opposed to using the Applications Monitor. (In-line error checking
has a much faster execution time.) For this example, it is assumed that you are
using GPIB-PCII/IIA interface board number zero (0). In addition, several more
of the NI-488.2 routines are used than were shown in Chapter 2. This program
finds and identifies all the Listeners on the bus prior to controlling the Fluke 45
instrument.
Step 1 – Preparation
The first step in writing the program is to load in the definitions of the NI-488.2
routines from a file that is on your distribution diskette. Include the declaration
file for the NI-488.2 QuickBASIC language interface as follows:
REM $INCLUDE: 'C:\GPIB-PC\QBDECL.BAS'
To check for errors, declare a subroutine to handle all possible GPIB errors.
DECLARE SUB gpiberr (msg$)
The following arrays are used to hold lists of IEEE-488 addresses, which are
used to find all of the Listeners on the bus.
DIM instruments% (31)
DIM result% (31)
DIM Reading AS STRING*30
PCII/IIA and NI-488.2 MS-DOS
3-2
© National Instruments Corp.
Chapter 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gpib-pciia181065-01181065-02

Table of Contents