Chapter 3
Developing Your Application
This chapter explains how to develop a GPIB application program using NI-488
functions and NI-488.2 routines.
Choosing How to Access the NI-488.2M DLL
Applications can access the NI-488.2M dynamic link library ( gpib-32.dll) either by
using an NI-488.2M language interface or with direct access.
If you need to access the gpib-32.dll from a language other than C, you must
directly access the gpib-32.dll. You can directly access the DLL from any
programming environment that allows you to request addresses of variables and functions
that a DLL exports. The gpib-32.dll exports pointers to each of the global variables:
•
user_ibsta is a pointer to ibsta
•
user_iberr is a pointer to iberr
•
user_ibcntl is a pointer to ibcntl
The gpib-32.dll also exports pointers to all of the NI-488 and NI-488.2 calls. For
example, it exports a pointer to the NI-488 ibwrt function. For a detailed example
showing how to use direct access, refer to the sample program dlldev.c that came
with your NI-488.2M software.
Choosing Between NI-488 Functions and NI-488.2 Routines
Your distribution disk contains two distinct sets of subroutines to meet your application
needs. Both of these sets, the NI-488 functions and the NI-488.2 routines, are compatible
across computer platforms and operating systems, so you can port programs to other
platforms with little or no source code modification. For most application programs, the
NI-488 functions are sufficient. You should use the NI-488.2 routines if you have a
complex configuration with one or more interface boards and multiple devices.
Regardless of which option you choose, the driver automatically addresses and performs
other bus management operations necessary for device communication.
The following sections discuss some differences between NI-488 functions and NI-488.2
routines.
© National Instruments Corp.
3-1
NI-488.2M UM for Windows NT