Items to Include in Your Multi-Device Application
You should include the following items in your application:
- Header filesIn 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 checkingCheck for errors after each NI-488.2 call.
- Error handlingDeclare 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");
}