Chapter 3
Developing Your NI-488.2 Application
©
National Instruments Corporation
3-13
NI-488.2 User Manual for Windows
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
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
ibbna
,
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 to get a pointer to the
exported function, you just need to call
GetProcAddress
passing the
name of the function as a parameter. For more information about the
parameters to use when you invoke the function, 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
The functions
ibbna
,
ibfind
,
ibrdf
, and
ibwrtf
all require an
argument that is a name.
ibbna
requires an interface name,
ibfind
requires an interface or device name, and
ibrdf
and
ibwrtf
require a file
name. Because Windows 2000/NT supports both normal (8-bit) and
Unicode (16-bit) characters,
gpib-32.dll
exports both normal and
Unicode versions of these functions. Because Windows 98/95 does not