National Instruments NI-488.2 ユーザーズマニュアル

ページ / 135
Chapter 4
Debugging Your Application
4-4
www.natinst.com
Timing Errors
If your application fails, but the same calls issued interactively in the 
Interactive Control utility 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. This 
should only be a problem with older, non-standard GPIB devices.
To check if your interactively issued NI-488.2 calls succeed, use the 
Interactive Control utility. To start the Interactive Control utility, complete 
the following steps:
1.
Select Start»Programs»National Instruments NI-488.2»Explore 
GPIB
 to start Measurement & Automation Explorer.
2.
Expand the Devices and Interfaces directory by clicking on the + next 
to the folder.
3.
Right-click on your GPIB interface and select Interactive Control 
from the drop-down menu that appears.
4.
At the command prompt, type NI-488.2 API calls to communicate 
interactively with the your instrument. For example, you might use 
ibdev
ibclr
ibwrt
ibrd
, and 
ibonl
.
To view the online help for Interactive Control, type 
help
 at the Interactive 
Control command prompt.
A well-behaved IEEE 488 device does not experience timing errors. 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 NI-488.2 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 are controlled by the 
device and your application can adjust itself and work independently on 
any platform. Other delay mechanisms probably exhibit differing behaviors 
on different platforms and thus might not eliminate timing errors.