From 7e756a47c5d082ac9ed6a66d4fc5b94f3efe1dab Mon Sep 17 00:00:00 2001 From: "FR@29iduser" <rodolakis@anl.gov> Date: Fri, 16 Sep 2022 09:09:27 -0500 Subject: [PATCH] branch shutter status --- build/lib/iexcode/instruments/IEX_VPU.py | 29 +++++++++++------------- iexcode/instruments/shutters.py | 8 +++---- 2 files changed, 17 insertions(+), 20 deletions(-) diff --git a/build/lib/iexcode/instruments/IEX_VPU.py b/build/lib/iexcode/instruments/IEX_VPU.py index 94f2411..fa624a1 100644 --- a/build/lib/iexcode/instruments/IEX_VPU.py +++ b/build/lib/iexcode/instruments/IEX_VPU.py @@ -237,8 +237,9 @@ def ID_on(verbose=True): if verbose: print("Starting ID - "+dateandtime()) - caput(ID_pvs()['energy_sp'],3.8) + #caput(ID_pvs()['energy_sp'],3.8) caput(ID_pvs()['main_power'],0,wait=True,timeout=18000) + sleep(5) def ID_start(ID_mode='RCP',QP_ratio=None, verbose=True): """ @@ -276,21 +277,17 @@ def ID_switch_mode(ID_mode): shutter_check(verbose=False) ID_state = ID_state_get() - try: - if ID_state_mode(ID_mode) != ID_state: - print("Turning ID off...") - ID_off(verbose=True) - sleep(5) - ID_ready() - - print("Switching ID mode, please wait...") - ID_mode_set(ID_mode) - ID_on(verbose=True) - sleep(5) - ID_ready() - print("ID Mode:",ID_mode) - except: - print_warning_message("Not a valid ID mode") + if ID_state_mode(ID_mode) != ID_state: + print("Turning ID off...") + ID_off(verbose=True) + ID_ready() + + print("Switching ID mode, please wait...") + ID_mode_set(ID_mode) + ID_on(verbose=True) + ID_ready() + print("ID Mode:",ID_mode_get()) + def ID_get(verbose=False): """ diff --git a/iexcode/instruments/shutters.py b/iexcode/instruments/shutters.py index 0ac7e11..01e5a9d 100644 --- a/iexcode/instruments/shutters.py +++ b/iexcode/instruments/shutters.py @@ -84,11 +84,11 @@ def branch_shutter_status(branch=None,verbose=False): """ if branch == None: branch = iex.BL.branch - pvA="PA:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" - pvB="PB:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" - #"ON" = 1 => shutter open + pvA = "PA:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" + pvB = "PB:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" + #"ON" = 1 => shutter blocking status=caget(pvA)+caget(pvB) - if status == 2: + if status == 0: shutter_open=True else: shutter_open=False -- GitLab