It is important to perform error handling in instrument control applications because there are several potential sources for errors. Error handling with instrument driver VIs is similar to error handling with other I/O VIs in LabVIEW. Each instrument driver VI contains an error in input and an error out output for passing error clusters from one VI to another. The error cluster contains a Boolean flag that indicates if an error occurred, an error code number, and a string that contains the location of the VI where the error occurred.
- VISA functions can return errors because VISA or the underlying software or hardware is not properly installed. For example, when communicating with GPIB instruments, NI-488.2 must be installed correctly to use a National Instruments GPIB controller card. Similarly, if the board is not installed or is not correctly configured, the instrument driver VIs return an error.
- VISA functions can return errors if the device you are accessing is not responding to the commands you have sent. The instrument could be incorrectly addressed, malfunctioning, or unable to understand the commands that are being sent.
Use the Simple Error Handler or General Error Handler VIs to detect and report these errors in an application.