Mercurial > ~darius > hgwebdir.cgi > pyinst
comparison rsib.py @ 21:6e7619f2dffd
Remove the test now it's in a separate file.
author | Daniel O'Connor <darius@dons.net.au> |
---|---|
date | Thu, 11 Aug 2011 21:17:42 +0930 |
parents | 55c8dae6d1db |
children | 226ea06bc050 |
comparison
equal
deleted
inserted
replaced
20:a124aa7067e7 | 21:6e7619f2dffd |
---|---|
185 return False | 185 return False |
186 elif rx == '\x00\x00\x00\x00\xa0\x64\x07': | 186 elif rx == '\x00\x00\x00\x00\xa0\x64\x07': |
187 return True | 187 return True |
188 else: | 188 else: |
189 raise "Unknown SRQ byte sequence - " + str(map(ord, rx)) | 189 raise "Unknown SRQ byte sequence - " + str(map(ord, rx)) |
190 | |
191 def test(r): | |
192 import numpy | |
193 from matplotlib import pylab | |
194 | |
195 r.write('*IDN?') | |
196 print "ID is " + r.read(5) | |
197 r.write("*RST") | |
198 r.write("INIT:CONT OFF") | |
199 r.write("SYST:DISP:UPD ON") | |
200 r.write("FREQ:STAR 85MHz;STOP 125MHz") | |
201 r.write("DISP:WIND:TRAC:T:RLEV -20dBm") | |
202 r.write("INIT;*WAI") | |
203 r.write("*OPC?") | |
204 print "OPC - " + r.read(10) | |
205 r.write("CALC:MARK:PEXC 6DB") | |
206 r.write("CALC:MARK:FUNC:TOI ON") | |
207 r.write("CALC:MARK:FUNC:TOI:RES?") | |
208 print "Result " + r.read(10) | |
209 | |
210 r.write("FORM:DAYA ASC") | |
211 r.write("CALC:LIM5:NAME 'TEST1'") | |
212 r.write("CALC:LIM5:COMM 'Upper limit line'") | |
213 r.write("CALC1:LIM5:TRAC 2") | |
214 r.write("TRAC1? TRACE1") | |
215 data = r.read(10) | |
216 #print "Data - " + dat | |
217 data = map(float, data.split(',')) | |
218 ary = numpy.array(data) | |
219 pylab.plot(ary) | |
220 pylab.show() | |
221 | |
222 |