Closedown
This commit is contained in:
@@ -0,0 +1,97 @@
|
||||
#Script imported from: Calibrate.xml
|
||||
|
||||
ret = 'Test failed'
|
||||
status = False
|
||||
|
||||
#Pre-actions
|
||||
try:
|
||||
caput('PO2DV-NCS-'+DEVICE+':INIT.PROC', '1')
|
||||
except:
|
||||
print "Unexpected error:", sys.exc_info()[0]
|
||||
ret = 'Unable to create channel'
|
||||
success = False
|
||||
raise
|
||||
sys.exit()
|
||||
|
||||
#TODO: Set the diplay names of positioners and detectors
|
||||
scan = ManualScan(['id000000'], ['id000001', 'id000002', 'id000003', 'id000004', 'id000005', 'id000006', 'id000007', 'id000008', 'id000009', 'id000010', 'idResult'] , [0.0], [1000.0], [1000])
|
||||
scan.start()
|
||||
|
||||
#Creating channels: dimension 1
|
||||
#PseudoPositioner id000000
|
||||
#ScalarDetector id000001
|
||||
id000001 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.MSTA', type = 'd')
|
||||
#ScalarDetector id000002
|
||||
id000002 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.RVAL', type = 'd')
|
||||
#ScalarDetector id000003
|
||||
id000003 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.VAL', type = 'd')
|
||||
#ScalarDetector id000004
|
||||
id000004 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.ATHM', type = 'd')
|
||||
#ScalarDetector id000005
|
||||
id000005 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.LLS', type = 'd')
|
||||
#ScalarDetector id000006
|
||||
id000006 = Channel('PO2DV-NCS-'+DEVICE+':MOTOR.HLS', type = 'd')
|
||||
#ScalarDetector id000007
|
||||
id000007 = Channel('PO2DV-NCS-'+DEVICE+':ENCODERraw', type = 'd')
|
||||
#ScalarDetector id000008
|
||||
id000008 = Channel('PO2DV-NCS-'+DEVICE+':ENCODER', type = 'd')
|
||||
#ScalarDetector id000009
|
||||
id000009 = Channel('PO2DV-NCS-'+DEVICE+':RDY', type = 'd')
|
||||
#ScalarDetector id000010
|
||||
id000010 = Channel('PO2DV-NCS-'+DEVICE+':ILK', type = 'd')
|
||||
|
||||
#Dimension 1
|
||||
#PseudoPositioner id000000
|
||||
for setpoint1 in range(0, 1000):
|
||||
readback1 = setpoint1
|
||||
sleep( 0.05 ) # Settling time
|
||||
#Detector id000001
|
||||
detector1 = id000001.get()
|
||||
#Detector id000002
|
||||
detector2 = id000002.get()
|
||||
#Detector id000003
|
||||
detector3 = id000003.get()
|
||||
#Detector id000004
|
||||
detector4 = id000004.get()
|
||||
#Detector id000005
|
||||
detector5 = id000005.get()
|
||||
#Detector id000006
|
||||
detector6 = id000006.get()
|
||||
#Detector id000007
|
||||
detector7 = id000007.get()
|
||||
#Detector id000008
|
||||
detector8 = id000008.get()
|
||||
#Detector id000009
|
||||
detector9 = id000009.get()
|
||||
#Detector id000010
|
||||
detector10 = id000010.get()
|
||||
#Manipulation idResult
|
||||
#Variable Mappings
|
||||
ready = detector9
|
||||
interlock = detector10
|
||||
count = setpoint1
|
||||
if count < 800:
|
||||
idResult = (0, "Note: the "+DEVICE+" calibration procedure did not complete.")
|
||||
if ready == 1 and interlock == 1:
|
||||
#print "The "+DEVICE+" drive was successfully initialised. The RDY and ILK signals indicate the drive is ready."
|
||||
ret = 'Drive successfully initialised'
|
||||
status = True
|
||||
else:
|
||||
#print "The RS calibration procedure failed. The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s)."
|
||||
ret = 'The RDY and ILK signals indicate the drive was NOT ready at the expected time (after 40s).'
|
||||
status = False
|
||||
scan.append ([setpoint1], [readback1], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, detector9, detector10, idResult])
|
||||
|
||||
#Closing channels
|
||||
id000001.close()
|
||||
id000002.close()
|
||||
id000003.close()
|
||||
id000004.close()
|
||||
id000005.close()
|
||||
id000006.close()
|
||||
id000007.close()
|
||||
id000008.close()
|
||||
id000009.close()
|
||||
id000010.close()
|
||||
|
||||
scan.end()
|
||||
@@ -0,0 +1,3 @@
|
||||
name=motor-slide
|
||||
description=Moves the device
|
||||
filename=Calibrate.xml
|
||||
@@ -0,0 +1,3 @@
|
||||
name=power-supply
|
||||
description=Moves HV
|
||||
filename=Calibrate.xml
|
||||
Reference in New Issue
Block a user