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 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
|