diff --git a/siriuspy/siriuspy/devices/bpm.py b/siriuspy/siriuspy/devices/bpm.py index c65b9282e..96d274a4a 100644 --- a/siriuspy/siriuspy/devices/bpm.py +++ b/siriuspy/siriuspy/devices/bpm.py @@ -1,4 +1,5 @@ """.""" +import time as _time import numpy as _np @@ -50,6 +51,7 @@ class BPM(_Device): 'ACQTriggerDataThres-SP', 'ACQTriggerDataThres-RB', 'ACQTriggerDataPol-Sel', 'ACQTriggerDataPol-Sts', 'ACQTriggerDataHyst-SP', 'ACQTriggerDataHyst-RB', + 'SwTagEn-Sel', 'SwTagEn-Sts', 'TbtTagEn-Sel', 'TbtTagEn-Sts', 'Monit1TagEn-Sel', 'Monit1TagEn-Sts', 'MonitTagEn-Sel', 'MonitTagEn-Sts', @@ -203,6 +205,16 @@ def tbt_mask_end(self, val): """.""" self['TbtDataMaskSamplesEnd-SP'] = val + @property + def fofb_sync_enbl(self): + """.""" + return self['SwTagEn-Sts'] + + @fofb_sync_enbl.setter + def fofb_sync_enbl(self, val): + """.""" + self['SwTagEn-Sel'] = val + @property def fofb_rate(self): """.""" @@ -723,3 +735,31 @@ def cmd_turn_off_switching(self): """Command Turn off Switching.""" self.switching_mode = _csbpm.SwModes.direct return self._wait('SwMode-Sts', _csbpm.SwModes.direct) + + def cmd_sync_tbt(self): + """Synchronize TbT acquisitions with Timing System.""" + self.tbt_sync_enbl = 1 + _time.sleep(0.1) + self.tbt_sync_enbl = 0 + return self._wait('TbtTagEn-Sts', 0) + + def cmd_sync_fofb(self): + """Synchronize FOFB acquisitions with Timing System.""" + self.fofb_sync_enbl = 1 + _time.sleep(0.1) + self.fofb_sync_enbl = 0 + return self._wait('SwTagEn-Sts', 0) + + def cmd_sync_monit1(self): + """Synchronize Monit1 acquisitions with Timing System.""" + self.monit1_sync_enbl = 1 + _time.sleep(0.1) + self.monit1_sync_enbl = 0 + return self._wait('Monit1TagEn-Sts', 0) + + def cmd_sync_monit(self): + """Synchronize Monit acquisitions with Timing System.""" + self.monit_sync_enbl = 1 + _time.sleep(0.1) + self.monit_sync_enbl = 0 + return self._wait('Monit1TagEn-Sts', 0) diff --git a/siriuspy/siriuspy/sofb/bpms.py b/siriuspy/siriuspy/sofb/bpms.py index dfa4ccb58..9023656aa 100644 --- a/siriuspy/siriuspy/sofb/bpms.py +++ b/siriuspy/siriuspy/sofb/bpms.py @@ -67,6 +67,7 @@ def __init__(self, name, callback=None): 'ACQTriggerDataPol': _csbpm.Polarity.Positive, 'ACQTriggerDataHyst': 0, 'TbtTagEn': _csbpm.EnbldDsbld.disabled, # Enable TbT sync Timing + 'SwTagEn': _csbpm.EnbldDsbld.disabled, # Enable FOFB sync Timing 'Monit1TagEn': _csbpm.EnbldDsbld.disabled, 'MonitTagEn': _csbpm.EnbldDsbld.disabled, 'TbtDataMaskEn': _csbpm.EnbldDsbld.disabled, # Enable use of mask @@ -100,6 +101,7 @@ def __init__(self, name, callback=None): 'ACQTriggerDataPol': 'ACQTriggerDataPol-Sel', 'ACQTriggerDataHyst': 'ACQTriggerDataHyst-SP', 'TbtTagEn': 'TbtTagEn-Sel', # Enable TbT sync with timing + 'SwTagEn': 'SwTagEn-Sel', # Enable FOFB sync with timing 'Monit1TagEn': 'Monit1TagEn-Sel', # Enable Monit1 sync with timing 'MonitTagEn': 'MonitTagEn-Sel', # Enable Monit sync with timing 'TbtDataMaskEn': 'TbtDataMaskEn-Sel', # Enable use of mask @@ -145,6 +147,7 @@ def __init__(self, name, callback=None): 'ACQTriggerDataPol': 'ACQTriggerDataPol-Sts', 'ACQTriggerDataHyst': 'ACQTriggerDataHyst-RB', 'TbtTagEn': 'TbtTagEn-Sts', + 'SwTagEn': 'SwTagEn-Sts', 'Monit1TagEn': 'Monit1TagEn-Sts', 'MonitTagEn': 'MonitTagEn-Sts', 'TbtDataMaskEn': 'TbtDataMaskEn-Sts', @@ -593,6 +596,20 @@ def tbt_sync_enbl(self, val): if pvobj.connected: pvobj.put(val, wait=False) + @property + def fofb_sync_enbl(self): + """.""" + pvobj = self._config_pvs_rb['SwTagEn'] + return pvobj.value if pvobj.connected else None + + @fofb_sync_enbl.setter + def fofb_sync_enbl(self, val): + """.""" + pvobj = self._config_pvs_sp['SwTagEn'] + self._config_ok_vals['SwTagEn'] = val + if pvobj.connected: + pvobj.put(val, wait=False) + @property def monit1_sync_enbl(self): """.""" diff --git a/siriuspy/siriuspy/sofb/orbit.py b/siriuspy/siriuspy/sofb/orbit.py index faea7630d..42be579ec 100644 --- a/siriuspy/siriuspy/sofb/orbit.py +++ b/siriuspy/siriuspy/sofb/orbit.py @@ -666,10 +666,14 @@ def acq_config_bpms(self, *args): def _synchronize_bpms(self): for bpm in self.bpms: + bpm.tbt_sync_enbl = _csbpm.EnbldDsbld.enabled + bpm.fofb_sync_enbl = _csbpm.EnbldDsbld.enabled bpm.monit1_sync_enbl = _csbpm.EnbldDsbld.enabled bpm.monit_sync_enbl = _csbpm.EnbldDsbld.enabled _time.sleep(0.5) for bpm in self.bpms: + bpm.tbt_sync_enbl = _csbpm.EnbldDsbld.disabled + bpm.fofb_sync_enbl = _csbpm.EnbldDsbld.disabled bpm.monit_sync_enbl = _csbpm.EnbldDsbld.disabled bpm.monit1_sync_enbl = _csbpm.EnbldDsbld.disabled