question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TRACE:DATA? times out in 0.3.0/master, works in 0.2

See original GitHub issue

Hi there, I experience the following issue: The script below works in 0.2 but does not in 0.3.0 (and master d12ef43a576fa4a856f686796b75cceb0efe8e26):

import visa
rm = visa.ResourceManager('@py')
scp = rm.open_resource('TCPIP::10.54.231.16::INSTR')
scp.write("*RST")
scp.write("INIT:CONT OFF")
scp.write("INIT;*WAI")
scp.query("TRACE1:DATA? TRACE1")

In 0.2 the last query returns in under a second In 0.3.0 I get a timeout (or with indefinite timeout it just sits there)

I tried to git bisect the issue. It stopped working with an EOFError in 15b814171ea048653f5bcd4db625c4b855557ef3. This EOFError was adressed in the more recent commit 7d876c5e5c08334815a2648911316bd5c23fb57a. With that commit it times out:

Traceback (most recent call last):
  File "traceminimal.py", line 7, in <module>
    scp.query("TRACE1:DATA? TRACE1")
  File "/home/test/visatest/env3/lib/python3.5/site-packages/pyvisa/resources/messagebased.py", line 569, in query
    return self.read()
  File "/home/test/visatest/env3/lib/python3.5/site-packages/pyvisa/resources/messagebased.py", line 413, in read
    message = self._read_raw().decode(enco)
  File "/home/test/visatest/env3/lib/python3.5/site-packages/pyvisa/resources/messagebased.py", line 386, in _read_raw
    chunk, status = self.visalib.read(self.session, size)
  File "/home/test/visatest/pyvisa-py/pyvisa-py/highlevel.py", line 350, in read
    raise errors.VisaIOError(ret[1])
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jake42commented, Sep 13, 2018

It depends on chunk_size. Adding the following to the script above:

for chunk in range(256, 10240+256, 256):
    scp.chunk_size = chunk
    try:
        scp.query("TRACE1:DATA? TRACE1")
        print(chunk)
    except pyvisa.errors.VisaIOError:
        pass

Outputs:

256
512
768
1024
1280
1536
1792
2048
2304
2560
2816
3072
3328
3584
3840
4864
5376
5888
6144
6912
7936
8448
9216
9984
0reactions
ssouffricommented, Nov 7, 2019

I also hit this bug in version 1.10.1 and can confirmed that the workaround works 👍. I discovered that the default chunk_size appears to be 20480 and wonder if this is a typo and was meant to be 2048?

Read more comments on GitHub >

github_iconTop Results From Across the Web

pic32mm0064gpl036 family - All Products
Hardware Real-Time Clock and Calendar (RTCC) ... EJTAG User Trace Data 1 register. ... for transferring test data in and out of the...
Read more >
Package List — Spack 0.12.1 documentation
All commands work transparently with both VCFs and BCFs, ... Versions: 0.3.1, 0.3.0, 0.2.1, 0.2.0, master; Build Dependencies: cmake, mpi, hdf5, silo, ...
Read more >
WM0011 - Mouser Electronics
MSL3 = out of bag storage for 168 hours at <30°C / 60% Relative Humidity. ... 0.2mA. 0.03mA. 0.05mA. 0.35mW. BootROM. (awaiting code...
Read more >
TRAVEO™ T2G 32-bit Automotive MCU - Infineon Technologies
4160 KB of code-flash with an additional 128 KB of work-flash ... DATA1[31:28]: “0”: master interface, PPU violation, “1': timeout detected, ...
Read more >
MM912_637, Intelligent integrated precision battery sensor
-0.3 to VDDA+0.25 ... enabled, all channels active in output compare mode with minimum timeout ... 0.2. µV. Resistor Threshold for OPEN Detection....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found