Solution
This error occurs due to missing GPIB commands or an incorrect sequence of GPIB commands. The most common cause is failing to include the
ibonl command.
GPIB devices use the
NI-488.2 driver, which defines a series of commands that must be used to properly initialize, communicate and clean-up the device. Ensure that the
ibdev,
ibclr and
ibonl commands are called throughout the communication session to prevent this error. These commands are responsible for:
- ibdev - Initializing a handle to the GPIB device.
- ibclr - Clearing the device.
- ibonl - Puts the handle offline, and properly releases the session.
Failing to call these commands for every GPIB session will eventually result in an error. This is because NI-488.2 will reserve/maintain any GPIB device handles until they are explicitly closed (by calling the corresponding
ibonl command or when the device loses power). NI-488.2 can only open a finite number of device handles and therefore, it is imperative that opened handles are always closed appropriately.
Follow the steps below to resolve this error:
- Ensure that the GPIB device has been properly configured by using GPIB Instrument Control Tutorial.
- This article defines the steps necessary to set up the GPIB device, install the correct drivers and test communication.
- Next, check the sequence of commands being sent to the GPIB device.
- This can either be done by checking the code that controls the GPIB instrument, or by generating a NI I/O Trace capture.
- NI I/O Trace is software that records communication chains that use NI drivers. Using this will provide a detailed report of the commands and point of error.
- Refer to Performing a Good NI I/O Trace Capture for Debugging/Troubleshooting for further instructions on how to do this.
- Verify that the ibdev command is called, followed by ibclr for each GPIB device.
- When the device handle is no longer being used, verify that ibonl is called for every active GPIB handle.