Chapter 4 Developing Your NI-488.2 Application© National Instruments Corporation 4-3 NI-488.2 User ManualLinuxNI-488.2 has libgpibapi.so—a dynamic library you can use from yourC/C++ applications. Refer to the Language-Specific ProgrammingInstructions for Linux section for more details on how to develop yourapplication.Choosing How to Use the NI-488.2 APIThe NI-488.2 API has two subsets of calls to meet your application needs.Both of these sets, the traditional calls and the multi-device calls, arecompatible across computer platforms and operating systems, so you canport programs to other platforms with little or no source code modification.For most applications, the traditional NI-488.2 calls are sufficient. If youhave a complex configuration with one or more interfaces and multipledevices, use the multi-device NI-488.2 calls. Whichever option youchoose, bus management operations necessary for device communicationare performed automatically.The following sections describe some differences between the traditionalNI-488.2 calls and the multi-device NI-488.2 calls.Communicating with a Single GPIB DeviceIf your system has only one device attached to each interface, the traditionalNI-488.2 calls are probably sufficient for your programming needs.A typical NI-488.2 application with a single device has three phases:• Initialization: use ibdev to get a handle and use ibclr to clear thedevice.• Device Communication: use ibwrt, ibrd, ibtrg, ibrsp, andibwait to communicate with the device.• Cleanup: use ibonl to put the handle offline.Refer to the sample applications that are installed with the NI-488.2software to see detailed examples for different GPIB device types.For NI-488.2 applications that need to control the GPIB in non-typicalways—for example, to communicate with non-compliant GPIBdevices—there is a set of low-level functions that perform rudimentaryGPIB functions. If you use these functions, you need to understand GPIBmanagement details such as how to address talkers and listeners. Refer toAppendix A, GPIB Basics, for some details on GPIB management.