Hello all,
I am using GPIB interface - National Instruments PCIe-GPIB. Kernel driver TNT4882. Configuration is as a pure slave - just listen and answer:
interface {
minor = 0 / board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. /
board_type = "ni_pci"
name = "violet" / optional name, allows you to get a board descriptor using ibfind() /
pad = 1 / primary address of interface /
sad = 0 / secondary address of interface /
timeout = T10s / timeout for commands /
eos = 0x0a /* EOS Byte, 0xa is newline and 0xd is carriage return */
set-reos = no /* Terminate read if EOS */
set-bin = no /* Compare EOS 8-bit */
set-xeos = no /* Assert EOI whenever EOS byte is sent */
set-eot = yes /* Assert EOI with last byte on writes */
master = no /* interface board is system controller */
}
I have to use polling mechanism for data detection on the bus. I am using 10ms timer and try to read data.
When no data are on the bus, system produces many console messages as follows:
tnt4882: minor 0 read timed out
tnt4882: read timed out
Exists any notifier possibility to detect if data are ready to read on the gpib bus? Like in serial/tcp communication?
Hi Stefan,
The normal way to wait for listen addressed to the slave is to wait on LACS (listener active state).
Attached is a little programme to demonstrate slave mode.
cheers,
-Dave
Thanks for Your answer, but there are some problems.
If master is sending the data without answer required, sometimes waiting the answer, sometimes not. In between sends REM signal, IFC and so on. And filling the console with timeout messages( it is only annoying.).
I have tried to use separate threads for LACS and TACS, but it is not allowed to use board descriptor at the same time. Mutex helped, but reading waiting was blocking the answer.
Hello Dave,
Thanks again for Your answer. All my problems would be solved if I will know when-read-data.
Then response will be not blocked. As I said, i am using reading in a loop and by 10ms timer I create time window for sending the response, if necessary ( when ibrd is not sitting on the bus).