I am using python's socket module to send a simple SCPI command to my Keysight device, but I get a blank response. Does anyone know what I am doing wrong?
Here is my simple script.
import socket
s = socket.socket()
print("connecting")
s.connect(("192.168.25.7",5024))
print("sending")
s.settimeout(10)
s.send("*IDN?\n")
print(s.recv(2048))
I expect this script to return
➜ ~ python hack_na.py
connecting
sending
Agilent Technologies,E5063A,MY54100104,A.03.00
➜ ~
But if I run the script, I get this output instead.
➜ ~ python hack_na.py
connecting
sending
➜ ~
I can confirm that I get the desigred output with telnet.
➜ ~ telnet 192.168.25.7 5024
Trying 192.168.25.7...
Connected to 192.168.25.7.
Escape character is '^]'.
SCPI> *IDN?
Agilent Technologies,E5063A,MY54100104,A.03.00
SCPI>
telnet> Connection closed.
Thank you all in advance.