Closed Siriusy closed 3 years ago
Could you check the following on your instrument ?
Thank you for your reply and manual.
You can actually change the interface language from the instrument front panel (page 38 of the manual). Could you post a minimal script using python-vxi11 ? I will try to dive (once again) to see what might be done differently and hence cause the problem.
Thank you,
the follow vxi11 code works well for me.
import vxi11
import numpy as np
inst = vxi11.Instrument('TCPIP0::192.168.0.254::INSTR')
print(inst.ask('*IDN?'))
inst.write('SYST:LANG "SCPI"')
The language setting is behind the ask function, hope may help you!
I came here because I switched from USB to Ethernet due to missing USB drivers for ARM (Raspberry Pi) from Keysight. So I am on the Raspberry Pi trying to connect to the Keysight 34465A without success.
@siriusy thank your for the hint with vxi11
this one works like a charm
@MatthieuDartiailh see my code below, maybe it helps for debugging
It is not the same error. I get Connection refused
Note that I had to come up with the address 'TCPIP0::192.168.1.221::5000::SOCKET'
myself, because I don't have a connection manager on the raspberry pi. The IP is correct and the Keysight manual states port 5000 as standard.
pyvisa
1.11.3
pyvisa-py
0.5.1
python
3.7.3
python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvisa as visa
>>> rm = visa.ResourceManager()
>>> ADR = 'TCPIP0::192.168.1.221::5000::SOCKET'
>>> dmm = rm.open_resource(ADR)
>>> dmm.query('*IDN?')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/pi/.local/lib/python3.7/site-packages/pyvisa/resources/messagebased.py", line 638, in query
self.write(message)
File "/home/pi/.local/lib/python3.7/site-packages/pyvisa/resources/messagebased.py", line 197, in write
count = self.write_raw(message.encode(enco))
File "/home/pi/.local/lib/python3.7/site-packages/pyvisa/resources/messagebased.py", line 157, in write_raw
return self.visalib.write(self.session, message)[0]
File "/home/pi/.local/lib/python3.7/site-packages/pyvisa_py/highlevel.py", line 543, in write
written, status_code = self.sessions[session].write(data)
File "/home/pi/.local/lib/python3.7/site-packages/pyvisa_py/tcpip.py", line 625, in write
size = self.interface.send(block)
ConnectionRefusedError: [Errno 111] Connection refused
python3
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import vxi11
>>> instr = '192.168.1.221'
>>> instr = vxi11.Instrument('192.168.1.221')
>>> print(instr.ask("*IDN?"))
Keysight Technologies,34465A,MY54505614,A.02.14-02.40-02.14-00.49-02-01
Can you try the following ? This will be closer to the vxi11 example since INSTR resources on TCPIP uses the vxi11 protocol by default.
>>> import pyvisa
>>> rm = pyvisa.ResourceManager()
>>> dmm = rm.open_resource("TCPIP::192.168.1.221::INSTR")
>>> dmm.query('*IDN?')
Hey, that worked! Thank you :D
Happy to help !
I 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 :
My code is simple, and the same code (different address) works well to all other instruments :
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:
More details of my computer:
I'm new to visa. So how can I fix this issue? Can anyone help?