Script execution

This commit is contained in:
boccioli_m
2015-05-20 12:02:24 +02:00
parent 7df6ed782f
commit c10130e034

View File

@@ -7,35 +7,35 @@ caput('PTEST-VME-VHQ1:Set-VA', '0')
sleep(4.0)
#TODO: Set the diplay names of positioners and detectors
scan = ManualScan(['Set-VA'], ['time', 'Actual-VA'] , [0.0], [50.0], [50])
scan = ManualScan(['SetVA'], ['time', 'ActualVA'] , [0.0], [50.0], [50])
scan.start()
#Creating channels: dimension 1
#LinearPositioner Set-VA
Set-VA = Channel('PTEST-VME-VHQ1:Set-VA', type = 'd')
#LinearPositioner SetVA
SetVA = Channel('PTEST-VME-VHQ1:Set-VA', type = 'd')
#Timestamp time
#ScalarDetector Actual-VA
Actual-VA = Channel('PTEST-VME-VHQ1:Actual-VA', type = 'd')
#ScalarDetector ActualVA
ActualVA = Channel('PTEST-VME-VHQ1:Actual-VA', type = 'd')
#Dimension 1
#LinearPositioner Set-VA
#LinearPositioner SetVA
for setpoint1 in frange(0.0, 50.0, 1.0, True):
if setpoint1 > 50.0 or setpoint1 < 0.0:
break
Set-VA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
readback1 = Set-VA.get()
SetVA.put(setpoint1, timeout=None) # TODO: Set appropriate timeout
readback1 = SetVA.get()
if abs(readback1 - setpoint1) > 0.5 : # TODO: Check accuracy
raise Exception('Actor Set-VA could not be set to the value ' + str(setpoint1))
raise Exception('Actor SetVA could not be set to the value ' + str(setpoint1))
sleep( 1.0 ) # Settling time
#Detector time
detector1 = float(java.lang.System.currentTimeMillis())
#Detector Actual-VA
detector2 = Actual-VA.get()
#Detector ActualVA
detector2 = ActualVA.get()
scan.append ([setpoint1], [readback1], [detector1, detector2])
#Closing channels
Set-VA.close()
Actual-VA.close()
SetVA.close()
ActualVA.close()
scan.end()