I am working on automating our environment here. I am having a problem with my E36102A power supply. I can issue write commands to it and it works fine but if I try to read anything (even *IDN?) I get a hang condition and script is hung.
Any ideas would be helpful.
A little background. I am running this on a LINUX box. If I use my laptop PC and try to talk to supply with Keysight Connection Expert I can write and read form it without problems. If I run same python scripts on my laptop PC I get same behavior as the LINUX box ( writes ok but read hangs).I have several other pieces of equipment (eg..Keysight 34465 meter) and they all work OK using my linux python scripts.
Working python script:
import visa
import time
#Go establish connection to the meter and read its instrument information
rm = visa.ResourceManager()
supply = rm.open_resource('TCPIP0::192.168.200.36::inst0::INSTR')
supply.read_termination = '\n'
#Set power supply output voltage
supply.write('SOUR:VOLT 3.3')
supply.close()
rm.close()
Failing python script:
import visa
import time
#Go establish connection to the meter and read its instrument information
rm = visa.ResourceManager()
supply = rm.open_resource('TCPIP0::192.168.200.36::inst0::INSTR')
supply.read_termination = '\n'
#the next command will just hang up. no timeout....nothing but hang
print supply.query('IDN?')
supply.close()
rm.close()
OK...found the magic. Do not know why this works and my snippet above does not. Maybe the newer equipment only supports the LXI socket model.
code snippet that works:
import visa
#Go establish connection to the meter and read its instrument information
rm = visa.ResourceManager()
supply = rm.open_resource('TCPIP0::192.168.200.37::5025::SOCKET')
supply.read_termination = '\n'
print supply.query('*IDN?')
supply.close()
rm.close()