diff --git a/script/Motor Test 3.py b/script/Motor Test 3.py index a773e27..195acfa 100644 --- a/script/Motor Test 3.py +++ b/script/Motor Test 3.py @@ -1,5 +1,9 @@ #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() @@ -7,23 +11,31 @@ scan.start() #Creating channels: dimension 1 #PseudoPositioner idX #RegionPositioner idInkr -idInkr = Channel('{DEVICE}:INKR:2', type = 'd') +#try one channel to see if accessible +try: + idInkr = Channel(DEVICE+':INKR:2', 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+':STA:1', type = 'd') #ScalarDetector idLogicalPosition -idLogicalPosition = Channel('{DEVICE}:IST:2', type = 'd') +idLogicalPosition = Channel(DEVICE+':IST:2', type = 'd') #ScalarDetector idDiameter -idDiameter = Channel('{DEVICE}:DIAM:2', type = 'd') +idDiameter = Channel(DEVICE+':DIAM:2', type = 'd') #ScalarDetector idMotorPosition -idMotorPosition = Channel('{DEVICE}:IST1:2', type = 'd') +idMotorPosition = Channel(DEVICE+':IST1:2', type = 'd') #ScalarDetector idPotiRaw -idPotiRaw = Channel('{DEVICE}:POSA:1', type = 'd') +idPotiRaw = Channel(DEVICE+':POSA:1', type = 'd') #ScalarDetector idPotiProc -idPotiProc = Channel('{DEVICE}:POSA:2', type = 'd') +idPotiProc = Channel(DEVICE+':POSA:2', type = 'd') #ScalarDetector idBtvsRaw -idBtvsRaw = Channel('{DEVICE}:IST3:1', type = 'd') +idBtvsRaw = Channel(DEVICE+':IST3:1', type = 'd') #ScalarDetector idBtvsProc -idBtvsProc = Channel('{DEVICE}:IST3:2', type = 'd') +idBtvsProc = Channel(DEVICE+':IST3:2', type = 'd') #Dimension 1 #PseudoPositioner idX @@ -79,3 +91,5 @@ idBtvsRaw.close() idBtvsProc.close() scan.end() +ret = 'Test done' +status = True