Skip to content
Snippets Groups Projects
Commit 7e756a47 authored by rodolakis's avatar rodolakis
Browse files

branch shutter status

parent 3d1ee21e
No related branches found
No related tags found
No related merge requests found
...@@ -237,8 +237,9 @@ def ID_on(verbose=True): ...@@ -237,8 +237,9 @@ def ID_on(verbose=True):
if verbose: if verbose:
print("Starting ID - "+dateandtime()) 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) caput(ID_pvs()['main_power'],0,wait=True,timeout=18000)
sleep(5)
def ID_start(ID_mode='RCP',QP_ratio=None, verbose=True): def ID_start(ID_mode='RCP',QP_ratio=None, verbose=True):
""" """
...@@ -276,21 +277,17 @@ def ID_switch_mode(ID_mode): ...@@ -276,21 +277,17 @@ def ID_switch_mode(ID_mode):
shutter_check(verbose=False) shutter_check(verbose=False)
ID_state = ID_state_get() ID_state = ID_state_get()
try: if ID_state_mode(ID_mode) != ID_state:
if ID_state_mode(ID_mode) != ID_state: print("Turning ID off...")
print("Turning ID off...") ID_off(verbose=True)
ID_off(verbose=True) ID_ready()
sleep(5)
ID_ready() print("Switching ID mode, please wait...")
ID_mode_set(ID_mode)
print("Switching ID mode, please wait...") ID_on(verbose=True)
ID_mode_set(ID_mode) ID_ready()
ID_on(verbose=True) print("ID Mode:",ID_mode_get())
sleep(5)
ID_ready()
print("ID Mode:",ID_mode)
except:
print_warning_message("Not a valid ID mode")
def ID_get(verbose=False): def ID_get(verbose=False):
""" """
......
...@@ -84,11 +84,11 @@ def branch_shutter_status(branch=None,verbose=False): ...@@ -84,11 +84,11 @@ def branch_shutter_status(branch=None,verbose=False):
""" """
if branch == None: if branch == None:
branch = iex.BL.branch branch = iex.BL.branch
pvA="PA:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" pvA = "PA:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL"
pvB="PB:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL" pvB = "PB:29ID:S"+branch.upper()+"S_BLOCKING_BEAM.VAL"
#"ON" = 1 => shutter open #"ON" = 1 => shutter blocking
status=caget(pvA)+caget(pvB) status=caget(pvA)+caget(pvB)
if status == 2: if status == 0:
shutter_open=True shutter_open=True
else: else:
shutter_open=False shutter_open=False
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment