EasyManuals Logo

National Instruments NI-488.2 NI-488.2 User Manual

National Instruments NI-488.2 NI-488.2
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #52 background imageLoading...
Page #52 background image
Chapter 4 Developing Your NI-488.2 Application
© National Instruments Corporation 4-15 NI-488.2 User Manual
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 fails, it returns a NULL pointer. The following
code fragment shows you how to verify that none of the calls to
GetProcAddress failed:
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");
}

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the National Instruments NI-488.2 NI-488.2 and is the answer not in the manual?

National Instruments NI-488.2 NI-488.2 Specifications

General IconGeneral
BrandNational Instruments
ModelNI-488.2 NI-488.2
CategorySoftware
LanguageEnglish