Logging Error Messages
From Agilent VISA.NET
Logging Error Messages
When developing or debugging your VISA application, you may want to view internal VISA messages while your application is running. You can do this by using the Event Viewer utility or the Debug Window. There are three choices for VISA logging:
- Off (default) for best performance
- Event Viewer
- Debug Window
Using the Event Viewer
The Event Viewer utility provides a way to view internal VISA error messages during application execution. Some of these internal messages do not represent programming errors; they indicate events which are being handled internally by VISA. The process for using the Event Viewer is:
- Enable VISA logging by clicking the Agilent IO Control
in the taskbar and then clicking
Agilent VISA Options > VISA Logging > Event Viewer. - Run your VISA program.
- View VISA error messages by running the Event Viewer. From the Agilent IO Control
, click Event Viewer. VISA error messages will appear in the application log of the Event Viewer utility.
Using the Debug Window
When VISA logging is directed to the Debug Window, VISA writes logging messages using the Win32 API call OutputDebugString(). The most common use for this feature is when debugging your VISA program using an application such as Microsoft Visual Studio. In this case, VISA messages will appear in the Visual Studio output window. The process for using the Debug Window is:
- Enable VISA logging by clicking the Agilent IO Control
in the taskbar and then clicking
Agilent VISA Options > VISA Logging > Debug Window. - Run your VISA program from Microsoft Visual Studio (or equivalent application).
- View error messages in the Visual Studio (or equivalent) output window.