|
From: Henning K. <ki...@ph...> - 2002-07-30 14:42:21
|
Hi!
I have a GPIB/CAMAC Interface 8901A from LeCroy. I can already access
CAMAC modules with the linux-gpib driver, but There are still some open
issues, because the documentation is too lousy (or I am too silly).
The Module can produce an SRQ and I want to use ibwait() to avoid busy
polling (to reduce cpu- and bus-activity).
From the interface manual:
"[...] The GPIB controller must perform a serial poll of all devices after
receiving a service request. When the 8901A is polled, it sends up to 5
bytes of information to the GPIB controller. The first byte is a status
byte which contains [...] bit 7 indicating whether or not the currently
addressed 8901A was the device which requested service. [...] The next
four bytes indicate the state of the LAM lines. [...]"
The LAM (look at me) lines indicate which instrument on the camac bus
initiated that SRQ.
ibwait() seems to work, but I'm not able to get the "up to 5 bytes" of
the serial poll. ibsrp() seems to always return only one byte.
What am I doing wrong?
I used the following code (I also tried using a string for camacstatus):
char camacstatus;
[...]
printf("\nWaiting for RQS...");fflush(stdout);
if( ibwait(camac,TIMO|RQS) & (ERR |TIMO))
{
gpiberr("ibwait Error");
/*exit(1);*/
}
printf("OK GOT IT\n");fflush(stdout);
ibrsp (camac,&camacstatus);
if (ibsta & ERR)
gpiberr("ibrsp Error");
printf("status:%d\n",camacstatus);
if(camacstatus & SRQ_BIT)
{
read_out_modules();
}
Additionally, how to I set a GPIB device to TALK? I sometimes need to set
it to talk without actually reading something back (to generate a CAMAC
bus cycle after initializing a CAMAC device, eg.).
Dipl.-Phys. Henning Kiel
Lehrstuhl fuer Experimentelle Physik IV
Universitaet Dortmund
Otto-Hahn-Str.4
44227 Dortmund
Germany
---------------------------------------
Phone: +49 231 755 3542
Fax : +49 231 755 3688
---------------------------------------
God is real,
unless declared integer.
"She sells sea shells by the sea shore.
The shells she sells are sea shells I'm sure."
|