AnsweredAssumed Answered

Control 33220A function generator with python socket

Question asked by ycq on Jan 16, 2019
Latest reply on Jan 18, 2019 by tsilchia001

Hello! I am trying to control a 33220A function generator using python socket. I am pretty new to socket programming and have no idea why my code doesn't work.

I did something like

command = 'some command string'

session=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
session.connect((ip_address,5025))

session.sendall(command.encode())

reply= session.recv(some_buf_size)

 

The socket can be connected but I got time out error when waiting for response, and on the screen of the function generator it says error occurred at remote interface command (but when I checked the remote interface command error queue it was empty, so I couldn't know what exactly was the error). It seems that the function generator doesn't understand my command.

Outcomes