John, regarding...
John Dobbins wrote:
Dear All,
I am confused about what is happening with an Analog In record
connected to an ASYN device. In particular this is a devGPIB device
with a command of type GPIBCVTIO.
I have created the custom convert routine for this devGPIB GPIBCVTIO
command and it appears to work, i.e. I have connected it to an Analog
In record and if from the EPICS command line I force the record to
process (dbpf aiRecord.PROC 1) and then examine the record's value
(dbpr aiRecord) it has correctly retrieved the value from hardware.
However, I next did the following:
I added a dfanout record and an Analog Out record. All three records
are passive. I set the DOL of the dfanout record to be the
"aiRecord.VAL PP" and OUTA of the dfanout record to be the
"aoRecord.VAL PP".
aiRecord -> dfanoutRecord -> aoRecord
I see this behavior when I make dfanoutRecord process:
1) aiRecord processes
3) ao record processes writing the stale value, i.e. the value the
aiRecord had before it processed
Note, from ASYN diagnostic output I see #1 happen and then #3 happen.
I infer that in between these the following happened
2) dfanoutRecord retrieved stale data from aiRecord and passed it to
aoRecord
So the question is why is the dfanout record retrieving the stale
value? It seems it must be that the value is retrieved before the
aiRecord is actually done processing.
The last lines of my convert routine are:
precord->val = floatData;
precord->udf = 0;
return 0;
}
After which the code in devGPIB is responsible for setting PACT = 0.
Have I gone wrong somewhere? Any advice appreciated.
info: EPICS 3.14.7, ASYN 4.2.1, Linux IOC
That's the way it's supposed to work. The only thing that waits for
asynchronous processing is the forward link of the record whose device
support is asynchronous. This is not peculiar to ASYN; it's a general
feature of asynchronous processing. A PP input link starts processing
that will eventually return the new value, but just takes whatever value
is there. Otherwise it would hold up all the other records being processed
by the same task.
John Dobbins wrote:
> A follow up note:
>
> I changed dfanoutRecord DOL to be "aiRecord.VAL NPP" and then used a seq
> record to first process aiRecord and then after a delay process
> dfanoutRecord.
>
> This fixes the bad behavior which is consistent with the theory that
> dfanout was grabbing aiRecord.VAL too soon.
>
> Also note that if I replace dfanout with an ao, DTYP = "Soft Channel" I
> see the same behavior, so this problem is not specific to dfanout.
You might also have the forward link of the AI record process the dFanout
record. Then you would not have to guess how long a delay to use.