EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20212022  2023  2024  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: caproto ioc alarm value leakage
From: "Lauer, Ken via Tech-talk" <tech-talk at aps.anl.gov>
To: "Troup, Euan (CASS, Marsfield)" <Euan.Troup at csiro.au>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 9 Feb 2021 18:04:41 +0000
Hi,

By default, pvproperties in a given PVGroup instance share the same alarm instance.

The easiest way to change this functionality is to specify a per-pvproperty alarm group using the alarm_group keyword argument.
It expects a string identifier, which should be reused on all other pvproperties that are expected to use the same alarm instance.

I'd expect that most caproto users are not looking regularly at tech talk, so I and other caproto developers would welcome you to join
the Slack chat organized by NSLS-II and collaborators: #caproto on https://nikea.slack.com/ . If an invite is required, do let me know.

Alternatively, don't hesitate to make an issue on the repository, even for such questions.

Best,
Ken

On 2/8/21, 9:00 PM, "Tech-talk on behalf of Troup, Euan (CASS, Marsfield) via Tech-talk" <tech-talk-bounces at aps.anl.gov on behalf of tech-talk at aps.anl.gov> wrote:

    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  



References:
caproto ioc alarm value leakage Troup, Euan (CASS, Marsfield) via Tech-talk

Navigate by Date:
Prev: Re: Firmware upgrade for MRF event generators and receivers Jeong Han Lee via Tech-talk
Next: Estimate Data Rate and BW requirements Manoussakis, Adamandios 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  <20212022  2023  2024 
Navigate by Thread:
Prev: caproto ioc alarm value leakage Troup, Euan (CASS, Marsfield) via Tech-talk
Next: Estimate Data Rate and BW requirements Manoussakis, Adamandios 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  <20212022  2023  2024 
ANJ, 09 Feb 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·