# Guidelines and Restrictions for Using the GPIB/GPIB 488.2 Library

Follow these guidelines when using the GPIB/GPIB 488.2 Library.

- Before performing any other operations, open the device with OpenDev, ibfind, or ibdev. Instrument modules must use OpenDev. The function you use to open a device returns an integer value that represents a device descriptor. All subsequent operations that involve this device require that you specify this device descriptor.
- If you use OpenDev, use CloseDev to close the device at the end of the program.
- Each GPIB/GPIB 488.2 Library function panel has three global controls labeled Status, Error, and Count. These controls show the values of the GPIB status (ibsta), error (iberr), and byte count (ibcntl) variables.

  - The Status control displays in hexadecimal format. The function panel help for the Status control explains the meaning of each bit in the status word. If the most significant bit is set, a GPIB error has occurred.

  - When an error occurs, the Error control displays an error number. The function panel help for the Error control describes the type of error associated with each error number.

  - The Count control displays the number of bytes transferred over the GPIB during the most recent bus transfer.

| Note When writing instrument modules, you must use the Device Manager functions, OpenDev and CloseDev, instead of ibfind or ibdev. You also must use the Device Manager functions in application programs that make calls to instrument modules. The Device Manager functions allow instrument modules to open devices without specific device names, thereby preventing device name conflicts. These functions also help the LabWindows/CVI interactive program ensure that devices are closed when they are no longer needed.