wf = PV.waveform("TEST:WAVEFORM", PV.Type.DOUBLE, 5) sc = PV.scalar("TEST:SCALAR", PV.Type.DOUBLE) st = PV.scalar("TEST:STATE", PV.Type.STRING) if st.read()=="Busy": print "Ongoing operation" raise Exception ("Ongoing operation") st.write("Busy") def after_read(record, scan): #print scan.result[ai1] + [record[ai1],] wf.write(scan.result[ai1]) sc.write(record.index) try: r= tscan((ai1, ai1), 5, 1.5, after_read=after_read, save=False) wf.write(r[ai1]) sc.write(len(r)) print wf.read() print sc.read() finally: st.write("Ready")