Error Checking
To develop programs you will need to create one or more error checking
routines. For example, you will need routines to check for errors in the
following operations:
–
I/O operations to the VXIbus, and
–
SCPI commands to the module.
I/O Error Checking
I/O error checking is specific to the type of I/O library you are using to
communicate with the VXIbus. In this manual and on the CD, the
HP VISA Transition Library is used.
Function calls to the HP VISA Transition Library (VTL) typically begin
with a lower case vi. For example, viPrintf is a VTL output function call.
The HP VTL I/O function calls return a variable that can be tested for errors
against the VTL variable VI_SUCCESS. In the examples, the variable err
is used to trap the VTL errors and is declared as a global variable of the
ViStatus type (defined in visa.h).
I/O error checking is illustrated in the following program example. The
VTL error checking function is named error_handler. Errors found are
reported to the standard output device.
SCPI Error
Checking
You must also check for errors reported by the SCPI driver. The SCPI
driver reports errors in response to the
SYSTem:ERRor?
query.
/* Repeat
…
*/
SYST:ERR?
/*
…
until no errors found */
The query returns two values: an integer error code and an error description
string. The integer value returns
+0
and the string returns “
No
Error
” if
no errors are found.
SCPI errors are reported in an error queue. The error queue is a first in, first
out queue. Each response to the
SYSTem:ERRor?
query removes one error
from the queue. Multiple SCPI errors may be generated by a single
incorrect command and the error queue should be read until it reports
+0,
"No Error"
.
Chapter 2
Programming Examples 47
Summary of Contents for E1418A
Page 6: ...Notes 6 Contents HP E1418A 8 16 Channel D A Converter Module ...
Page 10: ...Notes 10 HP E1418A User s Manual ...
Page 12: ...12 HP E1418A User s Manual ...
Page 105: ...TRIGger 105 HP E1418A SCPI Command Reference Chapter 3 ...
Page 111: ...Notes HP E1418A Command Quick Reference 111 HP E1418A SCPI Command Reference Chapter 3 ...
Page 135: ...135 HP E1418A Register Based Programming Appendix B ...
Page 157: ...Notes 156 HP E1418A Error Messages Appendix C ...
Page 170: ...Notes Appendix D Voltage Current Output Adjustment 169 ...
Page 174: ...Figure E 1 8 Channel Disassembly 172 Configuration and Disassembly Appendix E ...
Page 175: ...Figure E 2 16 Channel Disassembly Appendix E Configuration and Disassembly 173 ...
Page 192: ...Notes 192 HP E1418A 8 16 Channel D A Converter Module Index ...