U sing the ASCII character string method, the same effect is achieved using:
#include <fcntl.h>
#include <errno.h>
mainO
{
}
int eid;
if ((eid
=
open(1I Idev/raw_hpib
ll
,
D_RDWR»
==
-1) {
printf(lIopen failed, errno
=
%d\n
ll
,
errno);
exit(2);
}
io_reset(eid);
io_timeout_ctl(eid,
1000000);
hpib_send_cmnd(eid,
II?_II,
2);
I*? is ASCII for UNLISTEN and*1
1*_
is ASCII for UNTALK
*1
The array method is usually preferred when sending a large number of
commands or sending the same set of commands several times in the program
because the entire set of commands can be stored once then used whenever
needed. When the string method is used, the entire set of commands must
be specified as a string in each call to
hpib_send_cmnd.
It is preferred when
sending only a few commands or sending a set of commands only once in a
program.
Controlling the HP-IB Interface
3-15