Closed robsan00 closed 5 years ago
At the moment I can only suggest you give a try to the master branch of pyvisa-py. The USB backend is a nasty beast. I am working towards way to facilitate its development however there are far from ready. Let me know how it goes.
Thanks for the quick reply! Functionally the master branch seems to work fine (I don't get the issues mentioned above). However, I get spammed with UnknownAttribute errors in the log:
2019-09-09 09:38:34,688 | ERROR | pyvisa.set_attribute: Unknown attribute 1073676310 (0x3fff0016 - VI_ATTR_SEND_END_EN)
Traceback (most recent call last):
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/sessions.py", line 425, in set_attribute
return self._set_attribute(attribute, attribute_state)
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/usb.py", line 173, in _set_attribute
raise UnknownAttribute(attribute)
pyvisa-py.sessions.UnknownAttribute: Unknown attribute 1073676310 (0x3fff0016 - VI_ATTR_SEND_END_EN)
2019-09-09 09:38:34,689 | ERROR | pyvisa.set_attribute: Unknown attribute 1073676312 (0x3fff0018 - VI_ATTR_TERMCHAR)
Traceback (most recent call last):
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/sessions.py", line 425, in set_attribute
return self._set_attribute(attribute, attribute_state)
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/usb.py", line 173, in _set_attribute
raise UnknownAttribute(attribute)
pyvisa-py.sessions.UnknownAttribute: Unknown attribute 1073676312 (0x3fff0018 - VI_ATTR_TERMCHAR)
2019-09-09 09:38:34,690 | ERROR | pyvisa.set_attribute: Unknown attribute 1073676344 (0x3fff0038 - VI_ATTR_TERMCHAR_EN)
Traceback (most recent call last):
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/sessions.py", line 425, in set_attribute
return self._set_attribute(attribute, attribute_state)
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/usb.py", line 173, in _set_attribute
raise UnknownAttribute(attribute)
pyvisa-py.sessions.UnknownAttribute: Unknown attribute 1073676344 (0x3fff0038 - VI_ATTR_TERMCHAR_EN)
2019-09-09 09:38:34,690 | ERROR | pyvisa.get_attribute: Unknown attribute 1073676310 (0x3fff0016 - VI_ATTR_SEND_END_EN)
Traceback (most recent call last):
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/sessions.py", line 377, in get_attribute
return self._get_attribute(attribute)
File "/home/<censored>/venv/py3_pyvisa_py_dev/lib/python3.6/site-packages/pyvisa-py/usb.py", line 160, in _get_attribute
raise UnknownAttribute(attribute)
pyvisa-py.sessions.UnknownAttribute: Unknown attribute 1073676310 (0x3fff0016 - VI_ATTR_SEND_END_EN)
etc.
Good ! The unknown attribute has also been reported in another thread. If you have time feel free to have a look at it. I will try to have a look at it this week if I can manage.
@robsan00 Can you check https://github.com/pyvisa/pyvisa-py/pull/207 fixes your issue ?
Applying #207, the log errors are gone and everything else seems to work fine as well.
Thanks for testing. As mentioned in https://github.com/pyvisa/pyvisa/issues/458 this uncovered a different issue in some cases. I will try to fix it before merging.
I merged since it does go in the right direction even though it probably requires more work.
I have a problem with restoring from an error case where a query runs into a timeout. I am working under Ubuntu, executing the same script under Windows using NI-visa shows no problems.
Here an example script:
Under Ubuntu using pyvisa-py I get:
If I try to execute the script again, nothing works anymore, the serial communication seems to be broken:
I have to switch the device off and on again, to restore communication. Executing the same script under Windows (using NI-visa) works out just fine (also executing it multiple times).
Executing SCPI commands like "RST" or "CLS" after the timeout error, don't seem to help either.
Do I have to do any special clean-up in case of a timeout (where NI-visa is more lenient than pyvisa-py)?
The device I am working with, is a Pendulum CNT-90. Excerpt from pip freeze: