Menu

#75 Agilent 82357B: ibln() enters infinite loop if instrument is not on but adapter is

v1.0 (example)
open
nobody
None
6
2020-11-20
2020-11-14
Charles Lee
No

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.

Related

Bugs: #75

Discussion

  • Frank Mori Hess

    Frank Mori Hess - 2020-11-14

    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?

     
    • DaveP

      DaveP - 2020-11-14

      Looks like it hangs. I will look into it.

      On Sat, 14 Nov 2020, 03:24 Frank Mori Hess, fmhess@users.sourceforge.net
      wrote:

      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?


      Status: open
      Group: v1.0 (example)
      Created: Sat Nov 14, 2020 12:54 AM UTC by Charles Lee
      Last Updated: Sat Nov 14, 2020 12:54 AM UTC
      Owner: nobody

      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.


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/linux-gpib/bugs/75/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Bugs: #75

    • Charles Lee

      Charles Lee - 2020-11-16

      I think it's the former but not too sure myself since I did not create the library myself

       
      • DaveP

        DaveP - 2020-11-20

        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:

        $ findlisteners hpusb
        findlisteners: Scanning pads 0 to 30 on board "hpusb"
        findlisteners: Listener at pad  7
        findlisteners: Listener at pad 21 (board) 
        findlisteners: 1 device found.
        $ 
        

        No devices on the bus gives:

        $ findlisteners hpusb
        findlisteners: Scanning pads 0 to 30 on board "hpusb"
        findlisteners: 0 devices found.
        $ 
        

        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]


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.