diff --git a/robot_lib.py b/robot_lib.py index fecd4255..6ccff60a 100644 --- a/robot_lib.py +++ b/robot_lib.py @@ -407,12 +407,14 @@ def unmountRobotSample(puckPos,pinPos,sampID): #will somehow know where it came daq_lib.gui_message(message) logger.error(message) return 0 - #detDist = beamline_lib.motorPosFromDescriptor("detectorDist") - det_z_pv = 'XF:17IDC-ES:FMX{Det-Ax:Z}Mtr' - detDist = caget(f'{det_z_pv}.RBV') - if detDist < ROBOT_MIN_DISTANCE: - caput(f'{det_z_pv}.VAL', ROBOT_MIN_DISTANCE, wait=True) # TODO shouldn't this wait for SE transition or something?? - detDist = caget(f'{det_z_pv}.RBV') + if daq_utils.beamline == "fmx": + det_z_pv = 'XF:17IDC-ES:FMX{Det-Ax:Z}Mtr' + detDist = caget(f'{det_z_pv}.RBV') + if detDist < ROBOT_MIN_DISTANCE: + caput(f'{det_z_pv}.VAL', ROBOT_MIN_DISTANCE, wait=True) # TODO shouldn't this wait for SE transition or something?? + detDist = caget(f'{det_z_pv}.RBV') + else: + detDist = beamline_lib.motorPosFromDescriptor("detectorDist") if detDist < ROBOT_MIN_DISTANCE and abs(detDist - ROBOT_MIN_DISTANCE) > ROBOT_DISTANCE_TOLERANCE: logger.error(f"ERROR - Detector closer than {ROBOT_MIN_DISTANCE} and move than {ROBOT_DISTANCE_TOLERANCE} from {ROBOT_MIN_DISTANCE}! actual distance: {detDist}. Stopping.") return 0