From 8e7ffa32b41052efe7f80f640c75635026121236 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Tue, 29 Oct 2024 14:54:43 -0300 Subject: [PATCH 1/3] orbintlk.FIX: update LLRFStatus-Mon to monitor both LLRF A and B --- siriuspy/siriuspy/orbintlk/csdev.py | 9 +++++++-- siriuspy/siriuspy/orbintlk/main.py | 10 +++++----- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/siriuspy/siriuspy/orbintlk/csdev.py b/siriuspy/siriuspy/orbintlk/csdev.py index 62ab9a3c5..83078e6bc 100644 --- a/siriuspy/siriuspy/orbintlk/csdev.py +++ b/siriuspy/siriuspy/orbintlk/csdev.py @@ -38,7 +38,12 @@ class ETypes(_csdev.ETypes): 'DCCT13C4PsMtmTrigConfig', 'DCCT14C4PsMtmTrigConn', 'DCCT14C4PsMtmTrigStatusOK', 'DCCT14C4PsMtmTrigConfig', ) - STS_LBLS_LLRF = ('Connected', 'Configured') + STS_LBLS_LLRF = ( + 'A Connected', + 'A Configured', + 'B Connected', + 'B Configured', + ) _et = ETypes # syntactic sugar @@ -265,7 +270,7 @@ def get_database(self): 'value': self.DsblEnbl.Dsbl}, 'BPMStatus-Mon': {'type': 'int', 'value': 0b111111111}, 'TimingStatus-Mon': {'type': 'int', 'value': (1 << 19) - 1}, - 'LLRFStatus-Mon': {'type': 'int', 'value': 0b11}, + 'LLRFStatus-Mon': {'type': 'int', 'value': 0b1111}, 'BPMStatusLabels-Cte': { 'type': 'string', 'count': len(_et.STS_LBLS_BPM), 'value': _et.STS_LBLS_BPM}, diff --git a/siriuspy/siriuspy/orbintlk/main.py b/siriuspy/siriuspy/orbintlk/main.py index c7d75706c..f437a8f40 100644 --- a/siriuspy/siriuspy/orbintlk/main.py +++ b/siriuspy/siriuspy/orbintlk/main.py @@ -1233,16 +1233,16 @@ def _check_configs(self): self.run_callbacks('TimingStatus-Mon', self._timing_status) # LLRF Status - value = (1 << 2) - 1 - for dev in self._llrfs: + value = (1 << 4) - 1 + for i, dev in enumerate(self._llrfs): if dev.connected: - value = _updt_bit(value, 0, 0) + value = _updt_bit(value, 2*i, 0) fim_orbit = dev.fast_interlock_monitor_orbit fim_manual = dev.fast_interlock_monitor_manual okc = fim_orbit == self._llrf_intlk_state okc &= fim_manual == self._llrf_intlk_state - value = _updt_bit(value, 1, not okc) - self.run_callbacks('LLRFStatus-Mon', value) + value = _updt_bit(value, 2*i+1, not okc) + self.run_callbacks('LLRFStatus-Mon', value) # check time elapsed ttook = _time.time() - _t0 From 5cb084adeeb12c77ec80126618520493ed5af797 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Tue, 29 Oct 2024 14:56:32 -0300 Subject: [PATCH 2/3] orbintlk.FIX: monitor both RF EVEs --- siriuspy/siriuspy/orbintlk/main.py | 40 +++++++++++++++++++----------- 1 file changed, 26 insertions(+), 14 deletions(-) diff --git a/siriuspy/siriuspy/orbintlk/main.py b/siriuspy/siriuspy/orbintlk/main.py index f437a8f40..95857b26e 100644 --- a/siriuspy/siriuspy/orbintlk/main.py +++ b/siriuspy/siriuspy/orbintlk/main.py @@ -148,16 +148,27 @@ def __init__(self, tests=False): pvo.connection_callbacks.append(self._conn_callback_timing) # # RF EVE - trgsrc = _HLTimeSearch.get_ll_trigger_names('SI-Glob:TI-LLRF-PsMtm') - pvname = _LLTimeSearch.get_channel_output_port_pvname(trgsrc[0]) - self._llrf_evtcnt_pvname = f'{pvname.propty}EvtCnt-Mon' - self._everf_dev = _Device( - pvname.device_name, - props2init=[self._llrf_evtcnt_pvname, ], - auto_monitor_mon=True) - pvo = self._everf_dev.pv_object(self._llrf_evtcnt_pvname) - pvo.wait_for_connection() - self._everf_evtcnt = pvo.get() or 0 + trgsrcs = _HLTimeSearch.get_ll_trigger_names('SI-Glob:TI-LLRF-PsMtm') + pvnames = { + _LLTimeSearch.get_channel_output_port_pvname(src) + for src in trgsrcs + } + self._llrf_evtcnt_pvnames, self._everf_devs = dict(), dict() + for pvn in pvnames: + devn = pvn.device_name + propty = f'{pvn.propty}EvtCnt-Mon' + + self._llrf_evtcnt_pvnames[devn] = propty + + self._everf_devs[devn] = _Device( + devn, props2init=[propty, ], auto_monitor_mon=True + ) + + self._everf_evtcnts = dict() + for devn, propty in self._llrf_evtcnt_pvnames.items(): + pvo = dev.pv_object(propty) + pvo.wait_for_connection() + self._everf_evtcnts[devn] = pvo.get() or 0 # # HL triggers self._hltrig_devs = dict() @@ -1414,10 +1425,11 @@ def _do_callback_bpm_intlk(self): # wait minimum period for RF EVE event count to be updated _time.sleep(.1) # verify if RF EVE counted the event PsMtm - new_evtcnt = self._everf_dev[self._llrf_evtcnt_pvname] - if new_evtcnt == self._everf_evtcnt: - self._update_log('WARN:RF EVE did not count event PsMtm') - self._everf_evtcnt = new_evtcnt + for devn, propty in self._llrf_evtcnt_pvnames.items(): + new_evtcnt = self._everf_devs[devn][propty] + if new_evtcnt == self._everf_evtcnts[devn]: + self._update_log('WARN:RF EVE did not count event PsMtm') + self._everf_evtcnts[devn] = new_evtcnt # wait minimum period for BPM to update interlock PVs _time.sleep(2) # verify if EVG propagated the event Intlk From 8792ad31c504bb2c2d6f317dadc4a815197b6cb1 Mon Sep 17 00:00:00 2001 From: Ana Clara Oliveira Date: Fri, 1 Nov 2024 17:07:04 -0300 Subject: [PATCH 3/3] orbintlk.FIX: fix bug left in RF EVE handling --- siriuspy/siriuspy/orbintlk/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/siriuspy/siriuspy/orbintlk/main.py b/siriuspy/siriuspy/orbintlk/main.py index 95857b26e..502a6dab7 100644 --- a/siriuspy/siriuspy/orbintlk/main.py +++ b/siriuspy/siriuspy/orbintlk/main.py @@ -166,7 +166,7 @@ def __init__(self, tests=False): self._everf_evtcnts = dict() for devn, propty in self._llrf_evtcnt_pvnames.items(): - pvo = dev.pv_object(propty) + pvo = self._everf_devs[devn].pv_object(propty) pvo.wait_for_connection() self._everf_evtcnts[devn] = pvo.get() or 0