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

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

Advertisement

Applications That Use Multiple Interfaces or Communicate with
Multiple GPIB Devices
© National Instruments Corporation
Step 3a.
Use
to send the
ibwrt
Step 3b.
Use
to read the response from the device.
ibrd
Continue communicating with the GPIB device until you are finished.
Cleanup
Step 4. Place the Device Offline before Exiting Your Application
Use
to put the device handle offline before you exit the application.
ibonl
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 file
which 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 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
code examples to demonstrate these principles.
Chapter 4
query command to the device.
"*IDN?"
4-9
Developing Your NI-488.2 Application
ni488.h
4882query
NI-488.2 User Manual
,
source

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents