Chapter 4
Debugging Your Application
© National Instruments Corp.
4-5
NI-488.2M UM for Windo ws NT
Configuration Errors
Several applications require customized configuration of the GPIB driver. For example,
you might want to terminate reads on a special end-of-string character, or you might
require secondary addressing. In these cases, you can use either the
ibconf
utility to
permanently reconfigure the driver, or you can use the dynamic configuration function
call
ibconfig
to modify the driver while your application is running.
ibconfig
does not change the state of the driver permanently. Using dynamic
configuration automatically configures the driver as necessary.
Note : To change settings other than base I/O address, interrupt level, or DMA
channel, National Instruments recommends using
ibconfig
instead of
running the
ibconf
utility.
If your program uses dynamic configuration, it will always work regardless of the
previous configuration of the driver. Refer to the description of
ibconfig
in the
NI-488.2M Function Reference Manual for Windows NT for more information.
To test the configuration of your hardware, you can use the
ibdiag
program as
described in your getting started manual.
Timing Errors
If your application fails, but the same calls issued in
ibic
are successful, your program
might be issuing the NI-488.2 calls too quickly for your device to process and respond to
them. This problem can also result in corrupted or incomplete data.
A well behaved IEEE 488 device should hold off handshaking and set the appropriate
transfer rate. If your device is not well behaved, you can test for and resolve the timing
error by single-stepping through your program and inserting finite delays between each
GPIB call. One way to do this is to have your device communicate its status whenever
possible. Although this method is not possible with many devices, it is usually the best
option. Your delays will be controlled by the device and your application can adjust
itself and work independently on any platform. Other delay mechanisms will probably
cause varying delay times on different platforms.
Communication Errors
Repeat Addressing
Some devices require GPIB addressing before any GPIB activity. Devices adhering to
the IEEE 488.2 standard should remain in their current state until specific commands are
sent across the GPIB to change their state. You might need to configure your NI-488.2M
driver to perform repeat addressing if your device does not remain in its currently