Files
x03da/script/users/X-Treme users/launchOTF.py
2018-09-19 13:19:18 +02:00

43 lines
757 B
Python

Estart = 1280.0
Estop = 1292.0
OTFtime = 1.0
Eph.write(Estart)
while True:
erbk = round(MonoEnergy.read(),1)
if abs(erbk - Estart) < 0.3:
break
time.sleep(0.5)
print "done setting energy."
time.sleep(600)
caput('X03DA-OP-VG7:WT_SET',2) #open ES vacuum valve
caput('X03DA-OP-ST1:WT_SET_OPEN',1) # open ES Shutter
time.sleep(5.0)
caput('X03DA-OTF:E1', Estart)
caput('X03DA-OTF:E2', Estop)
caput('X03DA-OTF:TIME',OTFtime)
caput('X03DA-OTF:RUN','START')
while True:
ret=caget('X03DA-OTF:RUN')
if ret == 'STOP':
break
fname = caget('X03DA-OTF:MSG')
print "saved data to: ",fname
time.sleep(1.0)
caput('X03DA-OP-ST1:WT_SET_CLOSE',1) # close ES Shutter
caput('X03DA-OP-VG7:WT_SET',1) #close ES vacuum valve