comparison rs_fsp7_example.py @ 18:9bb8a9f3df6b

Update examples to match new code.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 10 Aug 2011 15:18:26 +0930
parents c2c13d804fce
children 438a5f1ddcd7
comparison
equal deleted inserted replaced
17:20df02be818a 18:9bb8a9f3df6b
53 # Trigger the sweep 53 # Trigger the sweep
54 r.write("INIT;*WAI") 54 r.write("INIT;*WAI")
55 55
56 # Wait up to 10 seconds for it to be done 56 # Wait up to 10 seconds for it to be done
57 r.write("*OPC?") 57 r.write("*OPC?")
58 print "OPC - " + r.read(10) 58 opc = scpi.getdata(r.read(10), int)
59 print "OPC - %d" % (opc)
59 60
60 # Set peak excursion 61 # Set peak excursion
61 r.write("CALC:MARK:PEXC 6DB") 62 r.write("CALC:MARK:PEXC 6DB")
62 # Find 3rd order intercept & get result 63 # Find 3rd order intercept & get result
63 r.write("CALC:MARK:FUNC:TOI ON") 64 r.write("CALC:MARK:FUNC:TOI ON")
64 r.write("CALC:MARK:FUNC:TOI:RES?") 65 r.write("CALC:MARK:FUNC:TOI:RES?")
65 print "Result " + r.read(10) 66 toi = scpi.getdata(r.read(1))
67 print "Result = %.2f" % (toi)
66 68
67 # Set data format 69 # Set data format
68 r.write("FORM REAL,32") 70 r.write("FORM REAL,32")
69 #r.write("FORM:DATA ASC") 71 #r.write("FORM:DATA ASC")
70 72