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  2021  <20222023  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  2021  <20222023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [SPAM] Re: Processing a record with asynPortDriver
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "Wang, Lin" <wanglin at ihep.ac.cn>, "sobhani, alex" <sobhaniba at ornl.gov>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Sat, 5 Nov 2022 17:16:32 +0000
> Typically, in which circumstances do we need to force callbacks to asynPortDriver client even when the value in parameter library does not change? To update the record's timestamp or any other consideration?

One circumstance is when using the asynInt32Average or asynFloat64Average device support for ai records.  That device support takes callbacks from the driver for each values, and averages them when the record processes.  For example, if the driver is doing callbacks at 100Hz and the record is processing every 1 second then it will average 100 readings.  In this case it is very important that device support receives all of the callbacks, even if the value does not change.  Otherwise, it won't produce the correct average.

Mark



From: Wang, Lin <wanglin at ihep.ac.cn>
Sent: Saturday, November 5, 2022 9:40 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; sobhani, alex <sobhaniba at ornl.gov>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: [SPAM] Re: Processing a record with asynPortDriver
 

Hello,


> getIntegerParam(param, &currentValue);
> setIntegerParam(param, currentValue+1);
> setIntegerParam(param, currentValue);
> callParamCallbacks();


Years ago, I also saw another colleague's code using the method mentioned above to force a record to process, but I do not understand. Typically, in which circumstances do we need to force callbacks to asynPortDriver client even when the value in parameter library does not change? To update the record's timestamp or any other consideration?


Thanks,

Lin




-----Original Messages-----
From:"Mark Rivers via Tech-talk" <tech-talk at aps.anl.gov>
Sent Time:2022-11-05 03:22:55 (Saturday)
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Sobhani, Alex" <sobhaniba at ornl.gov>
Cc:
Subject: [SPAM] Re: Processing a record with asynPortDriver

Hi Alex,

> Is there a function that I can call like this: "processRecord(param);", and it will just process the record associated with that param?

asynPortDriver does not actually know anything about processing records.  It can be used in C++ code that is not running in an IOC application at all.  So the real question is whether it is possible to force callbacks to the asynPortDriver client, which is typically, but not always, EPICS asyn device support.  

The answer is that the asynPortDriver parameter library caches value, status, and severity and only does callbacks if any of those has changed.  As you indicated you can force a callback like this, which is admittedly rather ugly.

getIntegerParam(param, &currentValue);
setIntegerParam(param, currentValue+1);
setIntegerParam(param, currentValue);
callParamCallbacks();

You could also toggle the value of status by replacing get/setIntegerParam with get/setParamStatus.

Mark





From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Sobhani, Alex via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, November 4, 2022 1:45 PM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Processing a record with asynPortDriver
 
I can use setIntegerParam(param, val); to change the value of a record,
and if val is different from the PV's current value, the record will get
processed. But if val is the same as the PV's current value the record
will not get processed. So if I want to process a record I have to find
out its current value using getIntegerParam, and then set it to
something other than this.


Is there a function that I can call like this: "processRecord(param);",
and it will just process the record associated with that param? I can
make one using the procedure I described in the previous paragraph but I
am sure there is a better way to do this.


Alex


References:
Processing a record with asynPortDriver Sobhani, Alex via Tech-talk
Re: Processing a record with asynPortDriver Mark Rivers via Tech-talk
Re: [SPAM] Re: Processing a record with asynPortDriver Wang, Lin via Tech-talk

Navigate by Date:
Prev: Alarm Log Table in Phoebus William F Badgett Jr via Tech-talk
Next: Re: Alarm Log Table in Phoebus Paul Sichta 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  <20222023  2024 
Navigate by Thread:
Prev: Re: [SPAM] Re: Processing a record with asynPortDriver Wang, Lin via Tech-talk
Next: Phoebus Alarm Log Table docs William F Badgett Jr 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  <20222023  2024 
ANJ, 07 Nov 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·