Hi Pierrick,
This is a special case of a general problem that I've run across in many applications. The problem is how to allow an EPICS client to control the timing of an EPICS 'put_callback' completion callback. There's a pretty easy way to do it, and there's a discussion of this in the sscan module's Scans.ppt powerpoint presentation.
For your particular application, I would make a database that includes a busy record, by which the sseq record can start processing that will not complete until the EDM client writes to a PV. Here's a database fragment:
record(sseq, "write_and_wait_for_EDM") {
...
field(STR3, "Busy")
field(WAIT3, "Wait")
field(LNK3, "sseq_record_writes_Busy_to_this CA")
...
}
record(busy, "sseq_record_writes_Busy_to_this") {
}
record(ao, "EDM_writes_to_this") {
field(FLNK, "clear_the_busy_record")
}
record(bo, "clear_the_busy_record") {
field(OUT, "sseq_record_writes_Busy_to_this.VAL")
}
So the sseq record writes the string "Busy" to the busy record's VAL, which causes it to process. (The sseq record must use a CA link, and its WAITn field must have the value "Wait". Also, the sseq record must write a string, rather than a number, because it's writing to an ENUM field, which the sseq record treats as a string-valued field.)
The busy record will apparently continue processing until somebody (anybody) writes "Done" (or 0) to its VAL field. EDM causes this to happen by writing to the ao record, which forward links to a bo record that clears the busy record. When that happens, the busy record will say it's done (by executing its forward link) and EPICS will send a completion callback to the sseq record.
Note that this fragment doesn't care what gets written to the ao record. It just waits for the ao record to process.
Also note that once the sseq record processes, it can't be used again until that busy record gets cleared, because you can have only one outstanding put_callback on a record.
Tim
----- Original Message -----
From: "Pierrick Hanlet" <[email protected]>
To: "Tech Talk" <[email protected]>
Sent: Friday, March 23, 2012 8:03:09 PM
Subject: waiting in sseq
Hi,
Perhaps I'm missing this from the documentation.
I have an sseq record in which I would like to perform a sequence, but after
some links are process, I want wait that a different record acquire a value
(e.g. from an edm panel) before continuing to process records in the sequence.
Is this possible? If so, would you be so kind as to give me an example?
Thanks,
Pierrick
"Whether you think you can or think you can't, either way, you are correct" -- Henry Ford
_______________________________________________________________
Pierrick Hanlet
IIT/Fermilab
+1-630-840-5555 (FNAL)
+1-312-567-5745 (IIT)
+1-630-697-8758/+44-79-48-860-1978 (US/UK mobile)
--
Tim Mooney ([email protected]) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab
- Replies:
- Goodbye and thanks for all the fish Rarback, Harvey M.
- References:
- waiting in sseq Pierrick Hanlet
- Navigate by Date:
- Prev:
about ram socket help 苏阳
- Next:
Highland T560 delay generator Pierrick Hanlet
- 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
- Navigate by Thread:
- Prev:
waiting in sseq Pierrick Hanlet
- Next:
Goodbye and thanks for all the fish Rarback, Harvey M.
- 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
|