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.

ResourceManager.open_resource() does not time out when trying to connect to TCP resource

See original GitHub issue

Hello, I am passing open_timeout parameter when connecting to a non-connected device’s resource name like this:

resource_manager.open_resource("TCPIP0::10.0.20.20::inst0::INSTR", open_timeout=100)

so I expect it to throw timeout error after just 100 milliseconds but it waits for about 5 seconds until a VisaIOError is thrown.

PyVisa version: 1.9.1 Visa backend: NI Python version: 3.6 64-bit

What might be the problem?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
MatthieuDartiailhcommented, Aug 16, 2019

I can reproduce. However it seems to be a bad documentation issue on PyVisa side since the VISA specification says (page 85 about viOpen):

If the accessMode parameter requests a lock, then this parameter specifies the absolute time period (in milliseconds) that the resource waits to get unlocked before this operation returns an error.

Hence in the absence of any lock, this timeout does not have any effect. We need to fix PyVISA documentation and possibly pyvisa-py implementation to conform to this (but this is lower priority).

0reactions
MatthieuDartiailhcommented, Sep 25, 2019

Closed by #451

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problem connecting to TCPIP instrument · Issue #12 · pyvisa ...
I'm trying to connect to my instrument via TCP/IP and I'm running into ... The SOCKET resource class is not implemented yet in...
Read more >
Communicating with your instrument - PyVISA - Read the Docs
After importing pyvisa , we create a ResourceManager object. If called without arguments, PyVISA will prefer the default backend (IVI) which tries to...
Read more >
What connection string do I use for pyvisa when my TCP ...
Tried ensuring that the newline termination character is sent and upped the timeout to 5 seconds (which did take effect, as it delayed...
Read more >
Establishing communication with PyVISA
The resource manager class contains a method that lists the devices it detects that are connected to the computer. The 'print' statement prints...
Read more >
Solved: Re: Connection TCP timeout - NXP Community
Using wireshark I have see that my router reject the SYN packet of TCP connection with windows size = 0 and I have...
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