Script execution
This commit is contained in:
@@ -70,64 +70,66 @@ idInkr.put(-100.0, timeout=None) # TODO: Set appropriate timeout
|
||||
start = idInkr.get()+direction
|
||||
countSteps = 0
|
||||
for setpoint1 in range(0, 3):
|
||||
sleep( 2 ) # Settling time
|
||||
sleep( 2 ) # Settling time
|
||||
#RegionPositioner idInkr
|
||||
for setpoint2 in frange(start, end, direction):
|
||||
readback1 = setpoint1
|
||||
sleep( 0.1 ) # Settling time
|
||||
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
readback2 = idInkr.get()
|
||||
if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
|
||||
ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
|
||||
success = False
|
||||
raise Exception(ret)
|
||||
#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()
|
||||
#end switches
|
||||
endH = idEndSwitchH.get()
|
||||
endL = idEndSwitchL.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
|
||||
for setpoint2 in frange(start, end, direction):
|
||||
readback1 = setpoint1
|
||||
sleep( 0.1 ) # Settling time
|
||||
idInkr.put(setpoint2, timeout=None) # TODO: Set appropriate timeout
|
||||
readback2 = idInkr.get()
|
||||
if abs(readback2 - setpoint2) > 1 : # TODO: Check accuracy
|
||||
ret = 'Actor idInkr could not be set to the value ' + str(setpoint2) + ' (current value: ' + str(readback2) + ')'
|
||||
success = False
|
||||
raise Exception(ret)
|
||||
#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()
|
||||
#end switches
|
||||
endH = idEndSwitchH.get()
|
||||
endL = idEndSwitchL.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
|
||||
countSteps = countSteps + 1
|
||||
scan.append ([countSteps], [readback2], [detector1, detector2, detector3, detector4, detector5, detector6, detector7, detector8, idDiff02, idDiff01])
|
||||
if endH>0.0 :
|
||||
#invert direction and swap start with end of translation
|
||||
end = startDefault
|
||||
start = readback2 - direction
|
||||
direction = -1.0
|
||||
print 'End H switch, changing direction to ' + str(direction)
|
||||
break
|
||||
if endL>0.0 :
|
||||
#invert direction and swap start with end of translation
|
||||
end = endDefault
|
||||
start = readback2 - direction
|
||||
direction = 1.0
|
||||
print 'End L switch, changing direction to ' + str(direction)
|
||||
break
|
||||
#invert direction and swap start with end of translation
|
||||
end = startDefault
|
||||
start = readback2 - direction
|
||||
direction = -1.0
|
||||
print 'End H switch, changing direction to ' + str(direction)
|
||||
break
|
||||
if endL>0.0 :
|
||||
#invert direction and swap start with end of translation
|
||||
end = endDefault
|
||||
start = readback2 - direction
|
||||
direction = 1.0
|
||||
print 'End L switch, changing direction to ' + str(direction)
|
||||
break
|
||||
|
||||
|
||||
|
||||
#set limits back
|
||||
idLimitH.put(145.0, timeout=None)
|
||||
|
||||
Reference in New Issue
Block a user