Chapter 4 Developing Your NI-488.2 Application
NI-488.2 User Manual 4-12 ni.com
Borland C/C++ (Version 4.0 or Later)
Before you compile your Win32 C application, make sure that the
following lines are included at the beginning of your program:
#include <windows.h>
#include "ni488.h"
To compile and link a Win32 console application named cprog
in a DOS shell, type the following on the command line:
bcc32 -w32 cprog.c borlandc_gpib-32.obj
Visual Basic (Version 4.0 or Later)
With Visual Basic, you can access the traditional NI-488.2 calls as
subroutines, using the BASIC keyword
CALL followed by the traditional
NI-488.2 call name, or you can access them using the
il set of functions.
With some of the NI-488.2 calls (for example
ibrd and Receive), the
length of the string buffer is automatically calculated within the actual
function or subroutine, which eliminates the need to pass in the length as
an extra parameter. For more information about function syntax for Visual
Basic, refer to the NI-488.2 online help. For instructions on accessing the
online help, refer to the Using the NI-488.2 Documentation section in
About This Manual.
Before you run your Visual Basic application, include the
niglobal.bas
and
vbib-32.bas files in your application project file.
Direct Entry with C
The following sections describe how to use direct entry with C.
gpib-32.dll Exports
gpib-32.dll exports pointers to the global variables and all of the
NI-488.2 calls. Pointers to the global variables (
ibsta, iberr, ibcnt,
and
ibcntl) are accessible through these exported variables:
int *user_ibsta;
int *user_iberr;
int *user_ibcnt;
long *user_ibcntl;
Except for the functions that have string parameters such as ibfind,
ibrdf, and ibwrtf, all the NI-488.2 call names are exported from
gpib-32.dll. Thus, to use direct entry to access a particular function and