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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: [SPAM] Re: Processing a record with asynPortDriver |
From: | "Wang, Lin via Tech-talk" <tech-talk at aps.anl.gov> |
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> |
Date: | Sat, 5 Nov 2022 22:40:00 +0800 (GMT+08:00) |
Hello,
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, ¤tValue);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 asynPortDriverI 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