Hello!
I am currently working with a set up that uses PyVISA-Py (which uses Linux GPIB as a back-end by generating c-types wrappers for it) to communicate with GPIB instruments. I am running into an issue where my program enters an infinite loop if I am connected to an adapter that is not attached to anything (or attached to an instrument that is off). My use case will require the program to run for other instruments even if the instrument connected to the GPIB adapter is off, so I would need it to not remain stuck in an infinite loop.
When I stepped through PyVISA-Py's code, it seemed to be an issue with the ibln() function, which does not return anything if the adapter is not connected to anything. Full issue: https://github.com/pyvisa/pyvisa/issues/565
Is there a way for ibln() to avoid the infinite loop if the adapter is not connected to anything?
For reference, I am using an Agilent 82357B adapter, and communicating with instruments is fine otherwise.
What do you mean by saying ibln "does not return anything"? Do you mean the function call never returns at all, or that it doesn't write anything to the found_listener pointer argument?
Looks like it hangs. I will look into it.
On Sat, 14 Nov 2020, 03:24 Frank Mori Hess, fmhess@users.sourceforge.net
wrote:
Related
Bugs: #75
I think it's the former but not too sure myself since I did not create the library myself
Hi,
The latest svn revision [r1924] has the changes to the user library as well as those to the ni and agilent usb kernel drivers to detect the situation where no device is connected to the bus.
Whereas the ni driver detects the condition in hardware the agilent driver must do this in software. To avoid the performance overhead of testing the condition on every command and write operation it is done only on timeout. Therefore when using ibln() with the agilent usb adapter, one should set a fairly short timeout (e.g. 30msec). Please see the example C programme findlisteners.c in linux-gpib-code/linux-gpib-users/examples.
You can test the programme and driver by running the programme:
With a device on the bus gives:
No devices on the bus gives:
hpusb is the name of my agilent usb adapter board from gpib.conf.
The remaining kernel drivers will be updated as time permits.
cheers,
-Dave
Related
Commit: [r1924]