<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent changes to 75: Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</title><link href="https://sourceforge.net/p/linux-gpib/bugs/75/" rel="alternate"/><link href="https://sourceforge.net/p/linux-gpib/bugs/75/feed.atom" rel="self"/><id>https://sourceforge.net/p/linux-gpib/bugs/75/</id><updated>2020-11-20T15:58:09.656000Z</updated><subtitle>Recent changes to 75: Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</subtitle><entry><title>#75 Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</title><link href="https://sourceforge.net/p/linux-gpib/bugs/75/?limit=25#886f/921a/be08" rel="alternate"/><published>2020-11-20T15:58:09.656000Z</published><updated>2020-11-20T15:58:09.656000Z</updated><author><name>DaveP</name><uri>https://sourceforge.net/u/dpenkler/</uri></author><id>https://sourceforge.net54df5bff9242ce328fe55ba42f3ae7e70e723078</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi,&lt;br/&gt;
The latest svn revision &lt;a class="alink" href="/p/linux-gpib/code/1924/"&gt;[r1924]&lt;/a&gt; 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.&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;You can test the programme and driver by running the programme:&lt;br/&gt;
With a device on the bus gives:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ findlisteners hpusb
findlisteners: Scanning pads &lt;span class="m"&gt;0&lt;/span&gt; to &lt;span class="m"&gt;30&lt;/span&gt; on board &lt;span class="s2"&gt;"hpusb"&lt;/span&gt;
findlisteners: Listener at pad  &lt;span class="m"&gt;7&lt;/span&gt;
findlisteners: Listener at pad &lt;span class="m"&gt;21&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;board&lt;span class="o"&gt;)&lt;/span&gt; 
findlisteners: &lt;span class="m"&gt;1&lt;/span&gt; device found.
$ 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;No devices on the bus gives:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;$ findlisteners hpusb
findlisteners: Scanning pads &lt;span class="m"&gt;0&lt;/span&gt; to &lt;span class="m"&gt;30&lt;/span&gt; on board &lt;span class="s2"&gt;"hpusb"&lt;/span&gt;
findlisteners: &lt;span class="m"&gt;0&lt;/span&gt; devices found.
$ 
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;hpusb is the name of my agilent usb adapter board from gpib.conf.&lt;/p&gt;
&lt;p&gt;The remaining kernel drivers will be updated as time permits.&lt;/p&gt;
&lt;p&gt;cheers,&lt;br/&gt;
-Dave&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#75 Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</title><link href="https://sourceforge.net/p/linux-gpib/bugs/75/?limit=25#886f/921a" rel="alternate"/><published>2020-11-16T20:04:01.665000Z</published><updated>2020-11-16T20:04:01.665000Z</updated><author><name>Charles Lee</name><uri>https://sourceforge.net/u/charlee674/</uri></author><id>https://sourceforge.netf1d96a20461f6f0c6e904b4dd19585b957ec51f6</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;I think it's the former but not too sure myself since I did not create the library myself&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>#75 Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</title><link href="https://sourceforge.net/p/linux-gpib/bugs/75/?limit=25#886f" rel="alternate"/><published>2020-11-14T02:23:50.225000Z</published><updated>2020-11-14T02:23:50.225000Z</updated><author><name>Frank Mori Hess</name><uri>https://sourceforge.net/u/fmhess/</uri></author><id>https://sourceforge.net60198a2b2ba83abca1168f0cb6e8e46a576cedcc</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;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?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is</title><link href="https://sourceforge.net/p/linux-gpib/bugs/75/" rel="alternate"/><published>2020-11-14T00:54:27.105000Z</published><updated>2020-11-14T00:54:27.105000Z</updated><author><name>Charles Lee</name><uri>https://sourceforge.net/u/charlee674/</uri></author><id>https://sourceforge.net3671c3de3426527edba5cc4685679cf67b4bf07e</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;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: &lt;a href="https://github.com/pyvisa/pyvisa/issues/565" rel="nofollow"&gt;https://github.com/pyvisa/pyvisa/issues/565&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Is there a way for ibln() to avoid the infinite loop if the adapter is not connected to anything?&lt;/p&gt;
&lt;p&gt;For reference, I am using an Agilent 82357B adapter, and communicating with instruments is fine otherwise.&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>