National Instruments NI-488.2 User Manual page 46

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

Advertisement

Chapter 3
Developing Your NI-488.2 Application
NI-488.2 User Manual for Windows
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");
}
Before exiting your application, you need to free
following command:
FreeLibrary(Gpib32Lib);
For more examples of directly accessing
entry sample programs
with the NI-488.2 software. For more information about direct entry, refer
to the online help for your development environment.
fails, it returns a NULL pointer. The following
gpib-32.dll
and
dlldevquery.c
3-16
with the
gpib-32.dll
, refer to the direct
, installed
dll4882query.c
www.natinst.com

Advertisement

Table of Contents
loading

Table of Contents