diff --git a/build/lib/iexcode/instruments/IEX_VPU.py b/build/lib/iexcode/instruments/IEX_VPU.py index 94f2411c3115cb1dbca18b020f9a8049d219beff..fa624a1e415dbbe237281200f845f2dc3bfcdf12 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 0ac7e1143db1c9911a8d2667da4aa0294bf561ca..01e5a9de1723f63d4200d2e1618d5a832c35f8dd 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