Applications That Use Multiple Interfaces Or Communicate With Multiple Gpib Devices; Items To Include; General Program Steps And Examples - National Instruments NI-488.2 User Manual

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
Applications That Use Multiple Interfaces or Communicate with
Multiple GPIB Devices
NI-488.2 User Manual for Windows
This section describes items you should include in your application and
provides general program steps with an NI-488.2 example.

Items to Include

Include the following items in your application:
Header files—In a C application, include the header files
and
. The standard Windows header file,
decl-32.h
contains definitions used by
prototypes for the NI-488.2 calls and constants that you can use in your
application.
Error checking—Check for errors after each NI-488.2 call.
Error handling—Declare and define a function to handle NI-488.2
errors. This function takes the device offline and closes the application.
If the function is declared as:
void gpiberr (char * msg); /*function prototype*/
Then your application invokes it as follows:
if (ibsta & ERR) {
gpiberr("NI-488.2 error");
}

General Program Steps and Examples

The following steps show you how to use the multi-device NI-488.2 calls
in your application. The NI-488.2 software includes the source code for an
example written in C,
written to use direct entry to access the
The NI-488.2 software also includes a sample program written in Visual
Basic,
query4882.frm
Initialization
Step 1. Become Controller-In-Charge (CIC)
Use
to initialize the bus and the GPIB interface so that the GPIB
SendIFC
interface is Controller-In-Charge (CIC). The only argument of
the GPIB interface number, typically 0 for
decl-32.h
, and the source code for the example
4882query.c
gpib-32.dll
.
GPIB0
3-10
windows.h
windows.h
, and
contains
decl-32.h
,
dll4882query.c
SendIFC
.
www.natinst.com
,
.
is

Advertisement

Table of Contents
loading

Table of Contents