EasyManuals Logo
Home>Agilent Technologies>Measuring Instruments>8163B

Agilent Technologies 8163B Programming Guide

Agilent Technologies 8163B
274 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #230 background imageLoading...
Page #230 background image
The Agilent 816x VXIplug&play Instrument Driver Error Handling
230 Agilent 8163A/B, 8164A/B & 8166A/B Mainframes, Fifth Edition
Error Handling
Events and errors within a instrument control program can be detected by
polling (querying) the instrument. Polling is used in application
development environments (ADEs) that do not support asynchronous
activities where callbacks can be used.
Programs can set up and use polling as shown below.
1 Declare a variable to contain the function completion code.
ViStatus errStatus;
Every driver function returns the completion code ViStatus.
If the function executes with no I/O errors, driver errors, or instrument
errors,
ViStatus is 0 (VI_SUCCESS).
If an error occurs,
ViStatus is a negative error code.
Warnings are positive error codes, and indicate the operation
succeeded but special conditions exist.
2 Enable automatic instrument error checking following each function
call.
hp816x_errorQueryDetect
(instrumentHandle, VI_TRUE);
When enabled, the driver queries the instrument for an error condition
before returning from the function.
If an error occurred,
errStatus (Step 1) will contain a code indicating that
an error was detected (
hp816x_INSTR_ERROR_DETECTED).
3 Check for an error (or event) after each function.
errStatus = hp816x_cmd(instrumentHandle, "SENS1:POW:RANG");
check(instrumentHandle, errStatus);
After the function executes, errStatus contains the completion code.
The completion code and instrument ID are passed to an error checking
routine. In the above statement, the routine is called 'check'.
4 Create a routine to respond to the error or event. This example queries
whether an error has occured, checks if the error is an instrument error
and then checks if the error is a driver error.

Table of Contents

Other manuals for Agilent Technologies 8163B

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Agilent Technologies 8163B and is the answer not in the manual?

Agilent Technologies 8163B Specifications

General IconGeneral
BrandAgilent Technologies
Model8163B
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals