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

[COM] query_binary_values timeout with HP 1660C logic analyzer using TCPIP SOCKET #492

Open
fenugrec opened this issue Mar 7, 2025 · 0 comments

Comments

@fenugrec
Copy link

fenugrec commented Mar 7, 2025

Instrument details

Output of pyvisa-info

Machine Details:
Platform ID: Linux-6.13.5-arch1-1-x86_64-with-glibc2.41
Processor:

Python:
Implementation: CPython
Executable: /usr/bin/python
Version: 3.13.2
Compiler: GCC 14.2.1 20250128
Architecture: ('x86', 64)
Build: Feb 5 2025 08:05:21 (#main)
Unicode: UCS4

PyVISA Version: 1.14.1

Backends:
ivi:
Version: 1.14.1 (bundled with PyVISA)
Binary library: Not found
py:
Version: 0.7.2
TCPIP INSTR: Available
Resource discovery:
- VXI-11: partial (psutil not installed)
- hislip: disabled (zeroconf not installed)
TCPIP SOCKET: Available
ASRL INSTR:
Please install PySerial (>=3.0) to use this resource type.
No module named 'serial'
USB INSTR:
Please install PyUSB to use this resource type.
No module named 'usb'
USB RAW:
Please install PyUSB to use this resource type.
No module named 'usb'
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

Hi, I'm having issues retrieving block data from an HP logic analyzer. This works :

read_termination='\n'` 
print(la.query('*idn?'))

but it seems that setting read_termination breaks every manner of binary transfer. I lost track of everything I tried, but the one that I think is the closest that should work :

>>> pyvisa.log_to_screen()
>>> print(la.query('*idn?'))
2025-03-07 12:50:10,432 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - reading 20480 bytes (last status <StatusCode.success_max_count_read: 1073676294>)
HEWLETT PACKARD,1660C,0,REV 02.00
>>> plist=la.query_binary_values(':syst:data?')
2025-03-07 12:50:25,985 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - reading 20480 bytes (last status <StatusCode.success_max_count_read: 1073676294>)
2025-03-07 12:50:26,048 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - reading 1044 bytes (last status None)
2025-03-07 12:50:26,073 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - reading 1018 bytes (last status <StatusCode.success_termination_character_read: 1073676293>)
2025-03-07 12:50:26,195 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - reading 24 bytes (last status <StatusCode.success_termination_character_read: 1073676293>)
2025-03-07 12:50:28,207 - pyvisa - DEBUG - TCPIP0::192.168.3.60::5025::SOCKET - exception while reading: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Buffer content: bytearray(b'\x00\x01\x00\x00\x00\x00\x00\x06\x00\x02HP-IB     
[ ... trimmed most of it]
x00\x00\n')
Traceback (most recent call last):
  File "<python-input-91>", line 1, in <module>
    plist=la.query_binary_values(':syst:data?')
  File "/usr/lib/python3.13/site-packages/pyvisa/resources/messagebased.py", line 750, in query_binary_values
    return self.read_binary_values(
           ~~~~~~~~~~~~~~~~~~~~~~~^
        datatype,
        ^^^^^^^^^
    ...<5 lines>...
        chunk_size,
        ^^^^^^^^^^^
    )
    ^
  File "/usr/lib/python3.13/site-packages/pyvisa/resources/messagebased.py", line 603, in read_binary_values
    self.read_bytes(expected_length - len(block), chunk_size=chunk_size)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyvisa/resources/messagebased.py", line 370, in read_bytes
    chunk, status = self.visalib.read(self.session, size)
                    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyvisa_py/highlevel.py", line 520, in read
    return data, self.handle_return_value(session, status_code)
                 ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/pyvisa/highlevel.py", line 251, in handle_return_value
    raise errors.VisaIOError(rv)
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.

I also tried specifying expect_termination=0 because I can see the trailing '\n' in there, but same result.
Any suggestions appreciated !

@fenugrec fenugrec changed the title [COM] Communication issue with HP 1660C logic analyzer using TCPIP SOCKET [COM] query_binary_values timeout with HP 1660C logic analyzer using TCPIP SOCKET Mar 7, 2025
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

1 participant