try:
#create an AF_INET, STREAM socket (TCP)
instrumentDirectSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
except (socket.error, msg):
print('Failed to create socket. Error code: ' + str(msg[0]) + ' , Error message : ' + msg[1])
instrumentDirectSocket.close()
exit()
print( 'Socket Created')
# Alter this host name, or IP address, in the line below to accommodate your specific instrument
host = 'k-n5245b-81275' # Or you could utilize an IP address.
port = 5025
waitTime = 0.2
measSelectFormat = ""
centerFrequency = 10.24E9
frequencySpan = 1E9
ifBandWidth = 1000
sweepPoints = 201
remote_ip = socket.gethostbyname( host )
instrumentDirectSocket.connect((remote_ip , port))
instrumentDirectSocket.sendall("*CLS\n")——我想用这个法子发命令过去,可行吗?
--
FROM 114.99.186.*