Another thing I just noticed that you are using field(PRIO, "HIGH") for SET_PROP. I am not sure if this has an unexpected effect on the record processing chains.
From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Hu, Yong via Tech-talk <tech-talk at aps.anl.gov>
Date: Thursday, March 30, 2023 at 8:44 AM
To: Wang, Andrew <wang126 at llnl.gov>, Mark Rivers <rivers at cars.uchicago.edu>, EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: Re: SSEQ record does not "appear" to be demanding callback completion from an asynchronous record forward-linked to another asynchronous record
Hi Andy,
Please take a look at the documentation:
https://epics.anl.gov/bcda/synApps/std/sseqRecord.html. Specifically, this snippet “Finally, if the sseq record successfully waits for targetRecord to finish processing, … , and
the sseq record cannot wait for this indirectly caused processing to finish
unless …”.
I think this explains why DOL1/LNK1/WAIT1 does not work as you expect (you probably think that ‘FLNK’ will cause GET_PROP to be completely processed when SET_PROP gets processed) and you need additional DOL2/LNK2/WAIT2 to make GET_PROP completely processed.
As always, it is tricky to make asynchronous records (i.e. SET_PROP, GET_PROP) get processed as you expect.
Cheers,
Yong
From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov>
Date: Tuesday, March 28, 2023 at 6:00 PM
To: Mark Rivers <rivers at cars.uchicago.edu>, EPICS tech-talk <tech-talk at aps.anl.gov>
Subject: RE: SSEQ record does not "appear" to be demanding callback completion from an asynchronous record forward-linked to another asynchronous record
Hi Mark,
I totally forgot about that. Thank you for bringing that to my attention.
I attempted your suggestion by doing the following:
record(ao, “VAL”)
{
field(SCAN, “Passive”)
}
record(sseq, “PROCESS_INST")
{
field(SCAN, "Passive")
field(SELM, "All")
field(DOL1, “VAL”)
field(LNK1, "SET_PROP 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”)
}
However, the values for SET_PROP and GET_PROP are still different when PRINT_SET_AND_GET processes.
To make it a little clearer, suppose that SET_PROP and GET_PROP both contain 25 initially. Then, I set VAL to be 55. Then, my hope would be that both SET_PROP and GET_PROP would both be 55 before PRINT_SET_AND_GET processes after I process
PROCESS_INST. However, when PRINT_SET_AND_GET processes, SET_PROP is 55 but GET_PROP is still 25. If I process PROCESS_INST again, then both SET_PROP and GET_PROP are 55. My current workaround is doing the following, but it is very verbose. I still feel like
the former method you proposed (if I understood it correctly) should work.
record(ao, “VAL”)
{
field(SCAN, “Passive”)
}
record(sseq, “PROCESS_INST")
{
field(SCAN, "Passive")
field(SELM, "All")
field(DOL1, “VAL”)
field(LNK1, "SET_PROP CA")
field(WAIT1, "Wait")
field(DOL2, “1”)
field(LNK2, "GET_PROP.PROC CA")
field(WAIT2, "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”)
}
Thanks,
Andy
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Tuesday, March 28, 2023 5:11 AM
To: EPICS tech-talk <tech-talk at aps.anl.gov>; Wang, Andrew <wang126 at llnl.gov>
Subject: Re: SSEQ record does not "appear" to be demanding callback completion from an asynchronous record forward-linked to another asynchronous record
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:
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.
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
|