Hi tech-talk,
I’m not sure if t his is the right forum, but I have a bit of a problem with a caproto-based IOC and alarms. The problem is if I have a PV that is updated with an alarm, a separate PV seems to inherit the alarm value when the second PV is updated. If this is due to write-combining for efficiency, is there a way to turn it off? I have based the IOC on the io_interrupt.py example from the caproto package. The IOC code is below, and also some output from camonitor showing the alarms on the 2 PVs:
cheers,
Euan
import threading
import time
from caproto.server import pvproperty, PVGroup, ioc_arg_parser, run
def start_monitor(nv_callback):
f = 1.0
while True:
time.sleep(1.0)
nv_callback(f)
f = (f + 1) % 20
class IOInt(PVGroup):
stringv = pvproperty(value = '', record='stringin', max_length = 10)
floatv = pvproperty(value = 0.0, record = 'ai', upper_alarm_limit = 18.0)
@floatv.startup
async def floatv(self, instance, async_lib):
queue = async_lib.ThreadsafeQueue()
thread = threading.Thread(target = start_monitor, daemon = True, kwargs = dict(nv_callback = queue.put))
thread.start()
while True:
value = await queue.async_get()
await self.stringv.write(str(value))
await self.floatv.write(value)
if __name__ == '__main__':
ioc_options, run_options = ioc_arg_parser(default_prefix = 'tio:', desc = 'test i/o interrupt')
ioc = IOInt(**ioc_options)
run(ioc.pvdb, **run_options)
camonitor -S tio:floatv tio:stringv
tio:floatv 2021-02-09 15:48:12.750651 13
tio:stringv 2021-02-09 15:48:12.750228 13.0
tio:stringv 2021-02-09 15:48:13.751457 14.0
tio:floatv 2021-02-09 15:48:13.755341 14
tio:stringv 2021-02-09 15:48:14.752766 15.0
tio:floatv 2021-02-09 15:48:14.753228 15
tio:stringv 2021-02-09 15:48:15.753765 16.0
tio:floatv 2021-02-09 15:48:15.754194 16
tio:stringv 2021-02-09 15:48:16.754858 17.0
tio:floatv 2021-02-09 15:48:16.755291 17
tio:stringv 2021-02-09 15:48:17.755992 18.0
tio:floatv 2021-02-09 15:48:17.756392 18 HIHI MAJOR
tio:stringv 2021-02-09 15:48:17.755992 18.0 HIHI MAJOR
tio:stringv 2021-02-09 15:48:18.757027 19.0 HIHI MAJOR
tio:floatv 2021-02-09 15:48:18.757424 19 HIHI MAJOR
tio:stringv 2021-02-09 15:48:19.758113 0.0 HIHI MAJOR
tio:floatv 2021-02-09 15:48:19.758522 0 LOLO MAJOR
tio:stringv 2021-02-09 15:48:19.758113 0.0 LOLO MAJOR
tio:stringv 2021-02-09 15:48:20.759297 1.0 LOLO MAJOR
tio:floatv 2021-02-09 15:48:20.759772 1
tio:stringv 2021-02-09 15:48:20.759297 1.0
tio:stringv 2021-02-09 15:48:21.760480 2.0
tio:floatv 2021-02-09 15:48:21.760907 2
- Replies:
- Re: caproto ioc alarm value leakage Lauer, Ken via Tech-talk
- Navigate by Date:
- Prev:
RE: [EXTERNAL] Re: Question about compress records Guyotte, Greg via Tech-talk
- Next:
RE: Firmware upgrade for MRF event generators and receivers Abdalla Ahmad via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
- Navigate by Thread:
- Prev:
Re: ADPilaus + NDFileHDF5 John Dobbins via Tech-talk
- Next:
Re: caproto ioc alarm value leakage Lauer, Ken via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
<2021>
2022
2023
2024
|