24 lines
641 B
Python
24 lines
641 B
Python
import ch.psi.pshell.scan.ScanAbortedException as ScanAbortedException
|
|
|
|
|
|
start = 1
|
|
end = 5
|
|
fe_slit_V_size.move(float(start))
|
|
|
|
|
|
fe_slit_V_size.moveAsync(float(end))
|
|
|
|
readback=fe_slit_V_size.getReadback()
|
|
#Execute the scan: sample undefined number of samples until a condition is met, with auto range
|
|
scan_completed=False
|
|
def after_read(record, scan):
|
|
global scan_completed
|
|
if abs(readback.take()-end) < 0.1:
|
|
print "Stopping"
|
|
scan_completed=True
|
|
scan.abort()
|
|
try:
|
|
r5 = mscan(readback, keithley_1a, -1, after_read=after_read, range="auto")
|
|
except ScanAbortedException as ex:
|
|
if not scan_completed: raise
|