Developing Your Application Chapter 3
NI-488.2 User Manual for Windows 3-6 © National Instruments Corp.
Writing Your NI-488 ApplicationThis section discusses items you should include in your application program, general
program steps, and an NI-488 example. In this manual the example code is presented in
C. The NI-488.2 software includes the source code for C (devsamp.c), Visual Basic
(devsamp.bas), direct entry functions in C (dlldev.c), and direct entry functions in
Visual Basic (dlldev.bas).
The NI-488.2 software also includes the source code for nine application examples,
which are described in Chapter 2, Application Examples.
Items to Include
• Include the appropriate GPIB header file. This file contains prototypes for the NI-488
functions and constants that you can use in your application program.
• Check for errors after each NI-488 function call.
• Declare and define a function to handle GPIB 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 ("GPIB error");
}