python - Telnet session to ESG Signal Generator -


i trying control signal generator using python. need change amplitude , frequency.`my code below:

import telnetlib host = "169.145.1.1" timeout     = 5 port    = 5023 tn = telnetlib.telnet(host, port , timeout) tn.read_until("scpi>", timeout) tn.write('freq 3ghz\r\n') tn.read_until("scpi>", timeout) tn.write('ampl 10dbm\r\n') tn.read_until("scpi>", timeout) tn.close()` 

when open telnet session directly on port 5023 able change freq , amp not using script above. debug session shows telnet connection successful , did send commands nothing changes on sig gen. thank you

i figure out. need add \r\n after each command , not \n. sig gen values changed once implemented change. updated script. thanks


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -