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: SSEQ record does not "appear" to be demanding callback completion from an asynchronous record forward-linked to another asynchronous record |
From: | "Hu, Yong via Tech-talk" <tech-talk at aps.anl.gov> |
To: | "Wang, Andrew" <wang126 at llnl.gov>, Mark Rivers <rivers at cars.uchicago.edu>, EPICS tech-talk <tech-talk at aps.anl.gov> |
Date: | Thu, 30 Mar 2023 13:14:21 +0000 |
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> Hi Andy, From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov> 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> 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:
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> 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 |