Appendix A
New NI-488M Functions
© National Instruments Corp.
A-3
AT-GPIB/NI-488M/AT&T UNIX
IBDEV(3)
(continued)
IBDEV(3)
If the
ibdev
call fails, a negative number is returned in place of
the device descriptor. There are two distinct errors that can occur
with the
ibdev
call:
•
If no device is available or the specified
boardindex
refers
to a non-existent board, it returns the EDVR error.
•
If one of the last five parameters is an illegal value, it returns
with a good device descriptor and the EARG error.
Example
ibdev
opens an available device and assigns it to access
gpib0
(
boardindex
= 0) with a primary address of 6 (
pad
=
6
), a
secondary address of hex 67 (
sad
=
0x67
), a timeout of 10 msec
(
tmo
=
7
), the END message enabled (
eot
=
1
) and the EOS
mode disabled (
eos
=
0
).
if ((ud = ibdev(0,6,0x67,7,1,0)) < 0) {
/* Handle GPIB error here. */
if (iberr == EDVR) {
/* Bad boardindex or no devices
* available.
*/
}
else if (iberr == EARG) {
/* The call succeeded, but at least one
* pad, sad, tmo, eos, or eot is incorrect.
*/
}
}