-
-
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
[COM] Communication issue with RIGOL oscilloscope (model DS1104z Plus) using pyvisa-py #414
Comments
First of all, query is not the right way to retrieve binary values. You can have a look at PyVISA documentation on the topic: https://pyvisa.readthedocs.io/en/latest/introduction/rvalues.html That being said USB support for Rigol device is challenging due to some deviation from the USBTMC norm. Could you enable logging ( |
Thank you for the tip. I started from there, but with 'CURV?' (not supported by the instrument) instead of 'WAV:DATA?'
Yes, of course! Input:
Output:
And an additional test (just ignore it if not useful):
Output 2:
|
Just for info: |
Sorry it appears I misread your code since I though you were retrieving binary data. As suggested in the log it looks like you are getting some incorrect message which is a somewhat known issue for Rigol. Can you check if a firmware update is available ? |
I've already checked for a firmware update. The device is already running the most recent (https://beyondmeasure.rigoltech.com/acton/attachment/1579/f-c9c0c4a9-722f-44b1-840e-a395ee6afb95/1/-/-/-/-/MSO_DS1000Z%20Release%20Notes.txt?sid=TV2:Q2jKaGpUj ). |
Ok. Could you place a breakpoint in the usbtmc.py file and look at what is the MsgId we get and that we do not expect (you can even make a PR to make this info part of the message if you feel like it). |
Well, I'm not a python expert... so, I'll need more instructions in order to provide useful info.
|
Thanks !
|
Here follows the data retrieved using both TCPIP (data_tcpip.txt) and USB (data_usb.txt). In both cases, the first 11 characters of the data block are included. By comparing the data, it looks that when using USB the data is truncated at position 117 of the data string. |
Sorry for the slow pace here. The last weeks have been very busy. I agree with your diagnostic. It is not a solution but you could try configuring your device to read binary data since in that case the information from the header will be used in place of using the hardware termination. Another workaround could be to specify Those are only workaround but they could help in your case. The root of the issue is that when we get a non conform packet we assume it is the last one which in your case is wrong. I am not sure what to do here. Could you print the raw response we get on line 482 in pyvisa_py/protocols/usbtmc.py (you can find this file in the site_packages folder of your Python installation). |
Instrument details
Output of
pyvisa-info
Machine Details:
Platform ID: Linux-5.15.38-x86_64-AMD_Ryzen_5_3500U_with_Radeon_Vega_Mobile_Gfx-with-glibc2.33
Processor: AMD Ryzen 5 3500U with Radeon Vega Mobile Gfx
Python:
Implementation: CPython
Executable: /home/fellype/progs_wo_installer/spyder/bin/python
Version: 3.9.18
Compiler: GCC 11.2.0
Bits: 64bit
Build: Sep 15 2023 13:03:38 (#main)
Unicode: UCS4
PyVISA Version: 1.13.0
Backends:
ivi:
Version: 1.13.0 (bundled with PyVISA)
#1: /usr/lib64/libvisa.so.0.0.0:
found by: auto
bitness: 64
Could not get more info:
VI_ERROR_NSUP_ATTR (-1073807331): The specified attribute is not defined or supported by the referenced object.
py:
Version: 0.7.1
ASRL INSTR: Available via PySerial (3.5)
USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1
USB RAW: Available via PyUSB (1.2.1). Backend: libusb1
TCPIP INSTR: Available
Resource discovery:
- VXI-11: ok
- hislip: disabled (zeroconf not installed)
TCPIP SOCKET: Available
VICP INSTR:
Please install PyVICP to use this resource type.
GPIB INSTR:
Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
No module named 'gpib'
GPIB INTFC:
Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
No module named 'gpib'
Problem description:
Almost all the communication commands I've tested works fine with the DS1104z+ oscilloscope. The only one that is not working properly is the ':WAV:DATA?' command - see page 2-219 (235 in sequential counting) of the documentation. It looks to work when executed, but only 9 points are obtained and they do not look to be correct.
Everything works fine when using NI-visa instead of pyvisa-py (tested on windows 10).
Here follows the code I'm using in the tests:
The text was updated successfully, but these errors were encountered: