Skip to content

[COM] Chunk size does not have any effect in pyvisa-py #563

@outrocarlos

Description

@outrocarlos

I would like to share my experience with transferring data from an oscilloscope Rigol to a computer, on one hand, and on the other hand, ask two questions.

Instrument: Oscilloscope Rigol MSO8154A
Communication: USB
Computer: PC running Ubuntu 24 or Ubuntu 25
Software: Python with PyVISA and pyvisa‑py or NI‑VISA backends
PyVISA function used for the transfer: query_binary_values("WAV:DATA?", datatype='B')
Data size: 10 MB

Initially, the data transfer did not work (a timeout occurred), even after updating the oscilloscope firmware to the latest version. However, after upgrading Ubuntu 24 to Ubuntu 25, pyvisa‑py went from version 0.5.1-3 to version 0.7.2-1, and the data transfer started to work, although at a very very low speed. I then switched from pyvisa‑py to NI‑VISA, and the transfer speed increased by a factor of 18x. Finally, I added the parameter chunk_size=10000000 to query_binary_values, and the transfer speed increased by another factor of 6x. Overall, this resulted in an 18x6=108x increase, leading to a data transfer speed of 2-3 MB/s.

Questions:

Why is NI‑VISA faster than Pyvisa‑py?

When using the chunk_size parameter with the Pyvisa-py backend, no improvement in speed is observed, unlike when using NI-VISA. Why?

BR.
Carlos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions