Files
tst/script/test_channels2.py
2026-03-13 15:28:30 +01:00

22 lines
587 B
Python

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")