#Script imported from: Motor Test 3.xml #by default, failed ret = 'Test failed' status = False #TODO: Set the diplay names of positioners and detectors scan = ManualScan(['idX', 'idInkr'], ['idMotorStatus', 'idLogicalPosition', 'idDiameter', 'idMotorPosition', 'idPotiRaw', 'idPotiProc', 'idBtvsRaw', 'idBtvsProc', 'idDiff01', 'idDiff02'] , [0.0, 0.0], [3000.0, 10.0], [3000, 20]) scan.start() #Creating channels: dimension 1 #try one channel to see if accessible #PseudoPositioner idX try: #RegionPositioner idInkr #idInkr = Channel(DEVICE+':INKR:2', type = 'd') idInkr = Channel(DEVICE+':MOTOR.ATHM', type = 'd') except: print "Unexpected error:", sys.exc_info()[0] ret = 'Unable to create channel' success = False raise sys.exit() #ScalarDetector idMotorStatus #idMotorStatus = Channel(DEVICE+':STA:1', type = 'd') idMotorStatus = Channel(DEVICE+':MOTOR.MSTA', type = 'd') #ScalarDetector idLogicalPosition #idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') idLogicalPosition = Channel(DEVICE+':MOTOR.STA, type = 'd') #ScalarDetector idDiameter #idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') idDiameter = Channel(DEVICE+':MOTOR.VAL', type = 'd') #ScalarDetector idMotorPosition #idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') idMotorPosition = Channel(DEVICE+':MOTOR.RVAL', type = 'd') #ScalarDetector idPotiRaw #idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') idPotiRaw = Channel(DEVICE+':ENCODERraw', type = 'd') #ScalarDetector idPotiProc #idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') idPotiProc = Channel(DEVICE+':ENCODER', type = 'd') #ScalarDetector idBtvsRaw #idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') idBtvsRaw = Channel(DEVICE+':MOTOR.LLS', type = 'd') #ScalarDetector idBtvsProc #idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') idBtvsProc = Channel(DEVICE+':MOTOR.HLS', type = 'd') #Dimension 1 #PseudoPositioner idX for setpoint1 in range(0, 3000): readback1 = setpoint1 sleep( 0.1 ) # Settling time #RegionPositioner idInkr for setpoint2 in frange(0.0, 10.0, 1.0, True) + frange(11.0, 0.0, -1.0, True): idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout readback2 = idInkr.get() if abs(readback2 - setpoint2) > -0.5 : # TODO: Check accuracy raise Exception('Actor idInkr could not be set to the value ' + str(setpoint2)) sleep( 5.0 ) # Settling time #Detector idMotorStatus detector1 = idMotorStatus.get() #Detector idLogicalPosition detector2 = idLogicalPosition.get() #Detector idDiameter detector3 = idDiameter.get() #Detector idMotorPosition detector4 = idMotorPosition.get() #Detector idPotiRaw detector5 = idPotiRaw.get() #Detector idPotiProc detector6 = idPotiProc.get() #Detector idBtvsRaw detector7 = idBtvsRaw.get() #Detector idBtvsProc detector8 = idBtvsProc.get() #Manipulation idDiff02 #Variable Mappings a = detector4 b = detector8 count = setpoint1 idDiff02 = a-b #Manipulation idDiff01 #Variable Mappings a = detector4 b = detector6 count = setpoint1 idDiff01 = a-b scan.append ([setpoint1, setpoint2], [readback1, readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01]) #Closing channels idInkr.close() idMotorStatus.close() idLogicalPosition.close() idDiameter.close() idMotorPosition.close() idPotiRaw.close() idPotiProc.close() idBtvsRaw.close() idBtvsProc.close() scan.end() ret = 'Test done' status = True