User Manual 54
EAR99 technology subject to restrictions on copyrights page.
def SocketQuery(Sock, cmd):
try :
Sock.sendall(cmd)
time.sleep(1)
except socket.error:
print ('Send failed')
sys.exit()
reply = Sock.recv(4096)
return reply
def SocketClose(Sock):
Sock.close()
time.sleep(.300)
def main():
global remote_ip
global port
global count
s = SocketConnect()
for i in range(10):
qStr = SocketQuery(s, b'*IDN?\n')
print (str(count) + ":: " + str(qStr))
count = count + 1
SocketClose(s)
input('Press "Enter" to exit')
if __name__ == '__main__':
proc = main()