This sample program illustrates the use of the standard VXIplug&play driver functions by sending a command using Microsoft® Visual C.
Date: Oct 2004
Language: Microsoft Visual C
OS Requirements: Microsoft Windows® 98 SE, NT® 4.0, ME, 2000, or XP
Additional Software: Agilent IO Libraries M.01.01.04 (or later)
Illustrates the use of the standard VXIplug&play driver functions using Microsoft Visual C:
Illustrates the use of several utility functions:
Sets the driver to check the instrument for errors.
Sends a command string to the instrument. In this Sample, it sends a command which generates an error which then illustrates the use of hp548xx_error_query and hp548xx_error_message (in the check_err macro). It is also used to send a command that clears event status registers.
One of the most interesting things about this Sample is the error detection portion, most of the second half of the program. After trying it out, you might think that setting errorQueryDetect to true is a great idea! In fact, it's not a bad idea for the hp548xx, but beware of the potential performance impact. With errorQueryDetect set on, the instrument is queried at least once, if not several times, for all functions which access the instrument. If your application is sensitive to performance, this might make the application too slow.
One effective strategy is to create and debug your application with errorQueryDetect set on, then remove it and leave it off for production applications.
AGILENT PROVIDES THIS FREE SOFTWARE "AS IS". ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO ANY WARRANTY OF NON-INFRINGEMENT, THE IMPLIED WARRANTIES OF MERCHANTABILITY, SATISFACTORY QUALITY, REASONABLE CARE AND SKILL, AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY DISCLAIMED. Agilent shall not be liable in any way whatsoever for any damages of any nature arising from its use. In no event shall Agilent be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to: procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability or tort (including negligence or otherwise) except if caused by willful misconduct or gross negligence arising in any way out of the use of this software, even if advised of the possibility of such damage and if it has been ensured that such data can be reconstructed with reasonable expenditure from data material provided in machine-readable form.
Windows is a U.S. registered trademark of Microsoft Corporation.
Microsoft is a U.S. registered trademark of Microsoft Corporation.
Windows NT is a U.S. registered trademark of Microsoft Corporation.
Copyright © 2004 Agilent Technologies, Inc.