Update to use read and query commands to communicate with RIGOL DG811 device
See original GitHub issueI am unable to run read and query commands on Rigol Device. I can run the same query on NI VISA test panel and communicate successfully but I fail when I do it using pyvisa. Note: I don’t face any issues when I use write command. it is only when I use read and query commands.
I attach my code below for reference:
>>> import visa
>>> rm = visa.ResourceManager('C:/Program Files (x86)/IVI Foundation/VISA/WinNT/agvisa/agbin/visa32.dll')
>>> inst = rm.open_resource('USB0::0x1AB1::0x0643::DG8A220800316::0::INSTR')
>>> print(inst.query("*IDN?"))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyvisa\resources\messagebased.py", line 613, in query
return self.read()
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyvisa\resources\messagebased.py", line 427, in read
message = self._read_raw().decode(enco)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyvisa\resources\messagebased.py", line 400, in _read_raw
chunk, status = self.visalib.read(self.session, size)
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1584, in read
ret = library.viRead(session, buffer, count, byref(return_count))
File "C:\Program Files (x86)\Python37-32\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 193, in _return_handler
raise errors.VisaIOError(ret_value)
pyvisa.errors.VisaIOError: VI_ERROR_IO (-1073807298): Could not perform operation because of I/O error.
Instrument details
- Model: Rigol Technologies,DG811,
- Communication: USB
- Link to the documentation (if available): https://int.rigol.com/Public/Uploads/uploadfile/files/20191118/20191118102948_5dd2021c6039d.pdf
Output of pyvisa-info
Machine Details: Platform ID: Windows-10-10.0.17763-SP0 Processor: Intel64 Family 6 Model 158 Stepping 9, GenuineIntel
Python: Implementation: CPython Executable: C:\Program Files (x86)\Python37-32\python.exe Version: 3.7.7 Compiler: MSC v.1900 32 bit (Intel) Bits: 32bit Build: Mar 10 2020 09:44:33 (#tags/v3.7.7:d7c567b08f) Unicode: UCS4
PyVISA Version: 1.10.1
Backends: ni: Version: 1.10.1 (bundled with PyVISA) #1: C:\Windows\system32\visa32.dll: found by: auto bitness: 32 Vendor: National Instruments Impl. Version: 20971520 Spec. Version: 5244928 py: Version: 0.4.1 ASRL INSTR: Available via PySerial (3.4) USB INSTR: Available via PyUSB (1.0.2). Backend: libusb0 USB RAW: Available via PyUSB (1.0.2). Backend: libusb0 TCPIP INSTR: Available TCPIP SOCKET: Available 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 functionality. No module named ‘gpib’
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top GitHub Comments
Could you send to me a screenshot of the other tabs of the VISA test panel ? Just in case there is some thing at odds with pyvisa defaults.
I had a similar problem with the DG811 where the ResourceManager was not able to find the device. After checking that the device works using Rigols software, I noticed that python-usbtmc is at least able to send commands even though it is not able to receive commands. Recently I’ve upgraded device firmware from 1.08 to 2.06 and now pyvisa works well (read and write) under manjaro linux with the proper udev rules. Upgrading the firmware may also solve your problem.