Hi Andy,
I think your problem is with the WRITE_INST record in the second IOC. It looks like perhaps you think that WRITE_INST will only write to the VAL field of SET_PROP, but not actually process the SET_PROP record. Then you have PROCESS_INST that will process
the SET_PROP record and wait for completion.
I think that would work if all of the records were in the same IOC. However, the WRITE_INST link to SET_PROP is a CA link, and that will always cause the SET_PROP record to process if the field you are writing to has the PP attribute, which the VAL field does.
That is explained here:
which says:
The options for process passive are:
- It is not possible to honor PP or NPP options; the put operation completes immediately but whether the destination record will process depends on the process passive attribute of the destination field.
- CA - Force the link to be a channel access link.
So when WRITE_INST processes it forces SET_PROP to process, and then immediately links to PROCESS_INST. PROCESS_INST will do a CA put, but SET_PROP will probably still be processing (PACT=TRUE).
If you combine WRITE_INST and PROCESS_INST into a single sseq record with WAIT1=Wait then I think it will do what you want.
I have not tested this, so I could be wrong.
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Sent: Monday, March 27, 2023 10:58 PM
To: EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: SSEQ record does not "appear" to be demanding callback completion from an asynchronous record forward-linked to another asynchronous record
Hi all,
Today I encountered something kind of interesting and would like to get some outside opinions.
To begin with, I have an IOC for an instrument that I shall call DemoInstr. I have a “setter” and “getter” record for one of its properties. The two records are shown below.
record(ao, “SET_PROP”)
{
field(SCAN, “Passive”)
field(DTYP, “stream”)
field(PRIO, "HIGH")
field(OUT, "@DemoInstr.proto setProp $(PORT)")
field(FLNK, “GET_PROP”)
}
record(ai, “GET_PROP”)
{
field(SCAN, “Passive”)
field(DTYP, “stream”)
field(INP, "@DemoInstr.proto getProp $(PORT)")
}
In a separate IOC that I shall call Setup, I declared a SEQ record called “WRITE_INST” that should write a value into “setProp” when it is processed. Then, “PROCESS_INST”, a SSEQ record, will process because it is forward-linked to “WRITE_INST”. “PROCESS_INST”
should wait for a completion callback with the way it is written. However, when “PRINT_SET_AND_GET” processes, it reports that GET_PROP still contains the previous value. Shouldn’t GET_PROP have been updated because of the completion callback? I feel like
I am missing something in my understanding of completion callbacks.
record(ao, “VAL”)
{
field(SCAN, “Passive”)
}
record(seq, "WRITE_INST")
{
field(SCAN, "Passive")
field(SELM, "All")
field(DOL1, “VAL")
field(LNK1, "SET_PROP")
field(FLNK, “PROCESS_INST ")
}
record(sseq, “PROCESS_INST")
{
field(SCAN, "Passive")
field(SELM, "All")
field(LNK1, "SET_PROP.PROC CA")
field(WAIT1, "Wait")
field(FLNK, “PRINT_SET_AND_GET”)
}
record(aSub, “PRINT_SET_AND_GET")
{
field(SCAN, "Passive")
field(SNAM, “print_set_and_get”)
field(INPA, “SET_PROP”)
field(INPB, “GET_PROP”)
}
Thank you,
Andy
Purple ribbon awareness
|