TCP/IP connection problems
See original GitHub issueI try to use Pyvisa and Pyvisa-py to control several instruments through Ethernet. Everything works well except an Anritsu Signal Generator named MG3694C. I got the error :
[Command: python3 -u /home/quantum/Downloads/MG3694C.py]
Traceback (most recent call last):
File "/home/quantum/Downloads/MG3694C.py", line 11, in <module>
print(inst.query('*IDN?'))
File "/usr/local/lib/python3.6/dist-packages/pyvisa/resources/messagebased.py", line 558, in query
self.write(message)
File "/usr/local/lib/python3.6/dist-packages/pyvisa/resources/messagebased.py", line 223, in write
count = self.write_raw(message.encode(enco))
File "/usr/local/lib/python3.6/dist-packages/pyvisa/resources/messagebased.py", line 201, in write_raw
return self.visalib.write(self.session, message)
File "/usr/local/lib/python3.6/dist-packages/pyvisa-py/highlevel.py", line 373, in write
raise errors.VisaIOError(ret[1])
pyvisa.errors.VisaIOError: VI_ERROR_IO (-1073807298): Could not perform operation because of I/O error.
My code is simple, and the same code (different address) works well to all other instruments :
import visa
import numpy as np
rm = visa.ResourceManager('@py')
ipaddr = 'TCPIP0::192.168.0.254::INSTR'
inst = rm.get_instrument(ipaddr)
print(inst.query('*IDN?'))
I spent a lot of time searching online try to find a solution, but failed. The problem seems to be in the buffer size, like in https://github.com/pyvisa/pyvisa/issues/174. However, the definition of the set_buffer function in pyvisa-py seems has not been finished. As follow:
#/usr/local/lib/python3.6/dist-packages/pyvisa/highlevel.py
def set_buffer(self, session, mask, size):
"""Sets the size for the formatted I/O and/or low-level I/O communication buffer(s).
Corresponds to viSetBuf function of the VISA library.
:param session: Unique logical identifier to a session.
:param mask: Specifies the type of buffer. (Constants.VI_READ_BUF, .VI_WRITE_BUF, .VI_IO_IN_BUF, .VI_IO_OUT_BUF)
:param size: The size to be set for the specified buffer(s).
:return: return value of the library call.
:rtype: :class:`pyvisa.constants.StatusCode`
"""
raise NotImplementedError
More details of my computer:
Machine Details:
Platform ID: Linux-4.15.0-39-generic-x86_64-with-Ubuntu-18.04-bionic
Processor: x86_64
Python:
Implementation: CPython
Executable: /usr/bin/python3
Version: 3.6.7
Compiler: GCC 8.2.0
Bits: 64bit
Build: Oct 22 2018 11:32:17 (#default)
Unicode: UCS4
PyVISA Version: 1.10.0.dev0
Backends:
ni:
Version: 1.10.0.dev0 (bundled with PyVISA)
Binary library: Not found
py:
Version: 0.3.1
ASRL INSTR: Available via PySerial (3.4)
USB INSTR: Available via PyUSB (1.0.2). Backend: libusb1
USB RAW: Available via PyUSB (1.0.2). Backend: libusb1
TCPIP INSTR: Available
TCPIP SOCKET: Available
GPIB INSTR:
Please install linux-gpib to use this resource type.
No module named 'gpib'
I’m new to visa. So how can I fix this issue? Can anyone help?
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Troubleshooting basic TCP/IP Problems - Computerworld
The first step in the troubleshooting process is to check the TCP/IP configuration. The easiest way to do this is to open a...
Read more >TCP/IP connectivity issues troubleshooting - Windows Client
Learn how to troubleshoot TCP/IP connectivity and what you should do if you come across TCP reset in a network capture.
Read more >3 Troubleshooting TCP/IP Connection Problems
Establishing a TCP/IP Connection · An invalid IP address has been specified. · An invalid host name has been specified, even if the...
Read more >TCP/IP troubleshooting - IBM
Common TCP/IP communication problems include the inability to communicate with a host on your network and routing problems. These are some solutions.
Read more >Troubleshooting TCP/IP - Cisco Systems
To efficiently troubleshoot a TCP/IP connectivity problem, it is necessary to identify a single pair of source and destination devices that are exhibiting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you try the following ? This will be closer to the vxi11 example since INSTR resources on TCPIP uses the vxi11 protocol by default.
Happy to help !