Items to Include in Your Traditional NI-488.2 Application

NI-488.2

Items to Include in Your Traditional NI-488.2 Application

You should include the following items in your application:

  • Header files—In a C application, include the header file ni4882.h. The ni4882.h file contains 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 instrument offline and closes the application. If the function is declared as:
    void gpiberr (const char * msg); /*function prototype*/

Then, your application invokes it as follows:

if (Ibsta() & ERR) { gpiberr("GPIB error"); }