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  <20172018  2019  2020  2021  2022  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  <20172018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: usage of updatePVs in pcaspy
From: Jameson Graef Rollins <[email protected]>
To: Wang Xiaoqiang <[email protected]>, EPICS tech-talk <[email protected]>
Date: Fri, 29 Dec 2017 14:08:06 -0800
Hi, Xiaoqiang.  I'm trying to understand when exactly driver.updatePVs()
needs to be called.  The reference documentation [0] implies that it
needs to be called after any setParam() call in order for clients to see
the update.  However, if I overload driver.write() and include some
setParam() calls, as far as I can tell it doesn't matter if I call
updatePVs() at the end or not, the behavior seems to be the same.

The peculiar thing I'm worried about is that in my current application
there are, under some circumstances, multiple record updates during a
single driver.write().  For example, before pcaspy 0.7.0, I was doing
something like this:

class MyDriver(pcaspy.Driver):
    ...
    def write(self, channel, value):
        ...
        self.setParam(channel, value)
        self.setParam(other_channel, other_value)
        ...
        self.pvDB[channel].flag = False
        self.updatePVs()
        return True

The 'pvDB[channel].flag = False' was to prevent subscribed clients from
seeing multiple updates for the primary record 'channel'.  In 0.7.0, it
seems that neither that, nor the final updatePVs() call are necessary.
However, I am now occasionally (less than 50% of the time) seeing
multiple client updates for the primary channel.  The sporadic nature of
the double updates makes me think there's some kind of race condition.
Regardless, I can't figure out what's going on, and how to uniformly
prevent redundant update in subscribed clients.

Any advice would be much appreciated.

jamie.

[0] http://pcaspy.readthedocs.io/en/latest/api.html?highlight=updatePVs

Attachment: signature.asc
Description: PGP signature


Replies:
Re: usage of updatePVs in pcaspy Wang Xiaoqiang (PSI)
Re: usage of updatePVs in pcaspy Jameson Graef Rollins

Navigate by Date:
Prev: Re: same value updates after initialization in pcaspy 0.7.0 Jameson Graef Rollins
Next: Re: usage of updatePVs in pcaspy Wang Xiaoqiang (PSI)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: same value updates after initialization in pcaspy 0.7.0 Jameson Graef Rollins
Next: Re: usage of updatePVs in pcaspy Wang Xiaoqiang (PSI)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  <20172018  2019  2020  2021  2022  2023  2024 
ANJ, 30 Dec 2017 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·