Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing functions #3

Open
MatthieuDartiailh opened this issue Jun 20, 2019 · 6 comments
Open

Missing functions #3

MatthieuDartiailh opened this issue Jun 20, 2019 · 6 comments

Comments

@MatthieuDartiailh
Copy link

Currently gpib_ctypes follows closely what is provided by linux-gpib. However some functions required to implement low level operations in pyvisa-py are missing. Currently the missing function that I believe are required are the following:

  • ibcac and ibgts: required for control atn
  • ibln: or a different function to specifically address a device
  • ibpct: required to implement pass control

I am not sure what is the best way to address this. I feel like we could add those and then it is up to users to know that there are departing from linux-gpib provided wrapper. I can probably find the time to put together a PR, if there is an interest.

MatthieuDartiailh added a commit to pyvisa/pyvisa-py that referenced this issue Jun 26, 2019
…IB INTFC

This re-organizes the code that before was heavily mixing INSTR and INTFC capabilities. It also patches gpib_ctypes to provide some extra functions we need. tivek/gpib_ctypes#3 tracks the issue that should also be discussed in linux-gpib.
bors bot added a commit to pyvisa/pyvisa-py that referenced this issue Oct 1, 2019
194: Add support GPIB INTFC r=MatthieuDartiailh a=MatthieuDartiailh

This re-organizes the code that, before, was heavily mixing INSTR and INTFC capabilities. It also patches gpib_ctypes to provide some extra functions we need. tivek/gpib_ctypes#3 tracks the issue that should also be discussed in linux-gpib.

This code has not been tested yet. Anybody that can help in testing that code is very welcome to do so. Note that to access all the new functionalities one needs gpib_ctypes since linux-gpib does not expose some functions to Python. The typical use case for those is described in: pyvisa/pyvisa#400.

@jondoesntgit you may be interested in this. I did not implement the buffer_read/write mostly because I am not sure they are necessary. Using read should work (you have to go through the VISA library for the time being but I would be interested in discussing adding it to the resource since it is supposed to support it.

Co-authored-by: MatthieuDartiailh <marul@laposte.net>
Co-authored-by: Dirk Niggemann <dirk.niggemann@gmail.com>
Co-authored-by: Matthieu Dartiailh <marul@laposte.net>
Co-authored-by: m.dartiailh <m.dartiailh@gmail.com>
Co-authored-by: Dirk Niggemann <37953389+dirkenstein@users.noreply.github.com>
@MatthieuDartiailh
Copy link
Author

ping @tivek

@tivek
Copy link
Owner

tivek commented Oct 25, 2019

@MatthieuDartiailh, linux-gpib was in recent past open to adding Python bindings for existing ib* functions. Let us add ibcac, ibgts, ibln, ibpct to gpib_ctypes. In parallel I will prepare a PR for linux-gpib's Python library so that both bindings are on par.

@tivek
Copy link
Owner

tivek commented Oct 25, 2019

ibln binding is already there, see gpib.listener().

@MatthieuDartiailh
Copy link
Author

Sounds good and thanks for the pointer to listener, I missed it.

@tivek
Copy link
Owner

tivek commented Oct 26, 2019

How should we name the new bindings, any preferences?
Eg. ibcac -> ibcac, ibgts -> ibgts, ibpct -> ibpct (easier for those familiar with ib.h)
Or do we follow gpib.py and name the functions descriptively, eg.: ibcac -> assert_atn, ibgts -> release_atn, ibpct -> pass_control (maybe easier for newcomers)?
I prefer the latter a bit more.

@MatthieuDartiailh
Copy link
Author

I agree the later is nicer. I went for simplicity mostly because it was only meant to be a short term solution. Maybe worth mentionning in the docstring the actual function being wrapped to ease the comparison with the GPIB specification though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants