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

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

Advertisement

© National Instruments Corporation
long *Pibcntl;
static int(__stdcall *Pibdev)
(int ud, int pad, int sad, int tmo, int eot,
int eos);
static int(__stdcall *Pibonl)
(int ud, int v);
Pibsta = (int *) GetProcAddress(Gpib32Lib,
(LPCSTR)"user_ibsta");
Piberr = (int *) GetProcAddress(Gpib32Lib,
(LPCSTR)"user_iberr");
Pibcntl = (long *) GetProcAddress(Gpib32Lib,
(LPCSTR)"user_ibcnt");
Pibdev = (int (__stdcall *)
(int, int, int, int, int, int))
GetProcAddress(Gpib32Lib, (LPCSTR)"ibdev");
Pibonl = (int (__stdcall *)(int, int))
GetProcAddress(Gpib32Lib, (LPCSTR)"ibonl");
If
GetProcAddress
code fragment shows you how to verify that none of the calls to
failed:
GetProcAddress
if ((Pibsta
== NULL) ||
(Piberr
== NULL) ||
(Pibcntl == NULL) ||
(Pibdev
== NULL) ||
(Pibonl
== NULL)) {
/* Free the GPIB library */
FreeLibrary(Gpib32Lib);
printf("GetProcAddress failed.");
}
Your Win32 application needs to dereference the pointer to access either
the status variables or function. The following code shows you how to call
a function and access the status variable from within your application:
dvm = (*Pibdev) (0, 1, 0, T10s, 1, 0);
if (*Pibsta & ERR) {
printf("Call failed");
}
Chapter 4
fails, it returns a NULL pointer. The following
4-15
Developing Your NI-488.2 Application
NI-488.2 User Manual

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents