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

Subject: Re: DBE_PROPERTY event of Enum type in PCAS
From: Ralph Lange <[email protected]>
To: EPICS Tech-Talk <[email protected]>
Date: Fri, 10 Jun 2016 08:51:41 +0200
Hi Xiaoqiang,

It looks like you found
    https://bugs.launchpad.net/epics-base/+bug/1510955

which had been initially submitted as
    https://github.com/pyepics/pyepics/issues/40

This seems to be a PCAS issue. Further analysis and/or patches are highly appreciated.

Thanks a lot,
~Ralph


On 09/06/2016 21:54, Wang Xiaoqiang (PSI) wrote:
Hi,

TL;DR: When DBE_PROPERTY event is posted in a PCAS application for an Enum typed PV, the client will be noticed but with the stale state strings.


As the title said, I have create an enum typed PV “MTEST:ENUM", initially with two states [ZERO, ONE], in a PCAS(py) application.
Then this is how I expand it to 3 states and send the DBE_PROPERTY event.
// pseudo code, only to show the sequence
dd = app_table.getDD(gddAppType_dbr_ctrl_enum)
dd[gddAppTypeIndex_dbr_ctrl_enum_value].put(0)
dd[gddAppTypeIndex_dbr_ctrl_enum_enums].put([‘ZERO’,’ONE’,’TWO'])
myPV.postEvent(DBE_PROPERTY, dd)

One the client, I put a monitor with type DBR_GR_ENUM and mask DBE_PROPERTY, and print the states string in the callback.
# a.py
def valueCB(epicsArgs, userArgs):
     print(epicsArgs['pv_statestrings’])

chan1 = CaChannel('MTEST:ENUM')
chan1.searchw()
chan1.add_masked_array_event(ca.DBR_GR_ENUM, None, ca.DBE_PROPERTY, valueCB)
chan1.flush_io()
while True:
     time.sleep(2)


The result is that the callback is called for the property change event, but the state string remains the same.
$ python a.py
('ZERO', 'ONE')
('ZERO', 'ONE’)
If I then run “caget -d DBR_GR_ENUM MTEST:ENUM”, it does print the changed state strings.


However if I load such a mbbo record into IOC,
record(mbbo, "MTEST:ENUM")
{
     field (ZRST, "ZERO")
     field (ONST, "ONE")
}
  and change the state string with "dbpf MTEST:ENUM.TWST TWO”, the client will receive the event with the changed state strings.
$ python a.py
('ZERO', 'ONE')
('ZERO', 'ONE', 'TWO’)

I have doubted the PCASpy implementation. So I tested the above mbbo record through the ca-gateway(2.1.0), the result is consistent with the PCASpy application. It receives the event but with the stale state strings.

The test is with Base 3.14.12.5.

Best
Xiaoqiang






References:
DBE_PROPERTY event of Enum type in PCAS Wang Xiaoqiang (PSI)

Navigate by Date:
Prev: Building EPICS for RTEMS TMS570LS3137 HDK Florian Feldbauer
Next: EPICS support for LonWorks field bus? Ralph Lange
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: DBE_PROPERTY event of Enum type in PCAS Wang Xiaoqiang (PSI)
Next: Building EPICS for RTEMS TMS570LS3137 HDK Florian Feldbauer
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·