National Instruments NI-488.2 NI-488.2 User Manual page 51

National instruments network hardware - networking hardware user manual
Hide thumbs Also See for NI-488.2 NI-488.2:
Table of Contents

Advertisement

Chapter 4
Developing Your NI-488.2 Application
NI-488.2 User Manual
In your Win32 application, you need to load
accessing the
gpib-32.dll
you how to call the
LoadLibrary
check for an error:
HINSTANCE Gpib32Lib = NULL;
Gpib32Lib=LoadLibrary("GPIB-32.DLL");
if (Gpib32Lib == NULL) {
return FALSE;
}
For the prototypes for each function, refer to the NI-488.2 online help.
For instructions on accessing the online help, refer to the
NI-488.2 Documentation
For functions that return an integer value, like
to the function needs to be cast as follows:
int (_stdcall *Pname)
where
is the name of the pointer to the function. For functions that
*Pname
do not return a value, like
function needs to be cast as follows:
void (_stdcall *Pname)
where
is the name of the pointer to the function. They are followed
*Pname
by the function's list of parameters as described in the NI-488.2 online help.
For instructions on accessing the online help, refer to the
NI-488.2 Documentation
Following is an example of how to cast the function pointer and how the
parameter list is set up for
int (_stdcall *Pibdev)(int ud, int pad, int sad, int tmo,
int eot, int eos);
int (_stdcall *Pibonl)(int ud, int v);
Next, your Win32 application needs to use
addresses of the global status variables and functions your application needs.
The following code fragment shows you how to get the addresses of the
pointers to the status variables and any functions your application needs:
/* Pointers to NI-488.2 global status variables */
int *Pibsta;
int *Piberr;
exports. The following code fragment shows
function to load
section in
About This
or
FindLstn
SendList
section in
About This
and
ibdev
ibonl
GetProcAddress
4-14
before
gpib-32.dll
gpib-32.dll
Using the
Manual.
or
, the pointer
ibdev
ibwrt
, the pointer to the
Using the
Manual.
functions:
to get the
and
ni.com

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents