-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
Locked resources are easily stolen by other VISA implementation #453
Comments
What kind of session are you using ? |
Both are sessions with exclusive lock |
I meant are you using GPIB, TCPIP, USB ? |
Sorry, TCPIP. |
Which protocol ? hislip or VXI11 (the default is VXI11 for TCPIP) |
I think VXI11 as second to last address word is "inst0". |
It is VXI11. I will need to check the code, I am not sure how locking is handled. |
Checking the VXI11 specs, there is not special option to locking beyond whether or not to block when attempting to acquire the lock. So I do not see what we may be doing wrong. Could you attempt to capture the network traffic when locking using pyvisa-py and using NI ? |
I use pyvisa-py on one PC and keysight IO installation on the other. |
Thanks !!! |
It appears that the pyvisa-py PC does not call DEVICE_LOCK as the Keysight IO equipped PC... Both are running the same test code and using the same library (that use pyvisa)... self.__resource__ = DEFAULT_RESOURCE_MANAGER.open_resource(self.Address, timeout=self.__timeout__, access_mode=AccessModes.exclusive_lock) |
It seems that highlevel.py open method does not use access_mode argument. |
You are welcome to make a PR. For the specific case at hand, I suggest you start with only supporting exclusive locking. Reading the specs I think shared lock cannot work between VISA libraries. However supporting properly nested locking seems worth it. Let me know if you need any guidance. |
Note that there is a (partially implemented, lock type is not being respected at the moment) implementation of |
Do you recommand me a document to build the implementation from it ? |
You can have a look at the VISA specification here: https://www.ivifoundation.org/downloads/Architecture%20Specifications/IVIspecstopost10-22-2018/vpp43_2018-10-19.pdf |
When I apply an exclusive lock to a session, the session can be stolen by another session. I tested this using pyvisa with pyvisa-py on one computer and pyvisa with IVI VISA installed on the other computer.
To Reproduce
Steps to reproduce the behavior:
The text was updated successfully, but these errors were encountered: