Something like this might work:
record(ao, "$(P):Setpoint") {
field(DTYP, "stream")
field(DESC, "Setpoint temperature")
field(OUT, "@ls336.proto setSETP($(OUT)) $(PORT) $(ADDR)")
field(FLNK, "$(P):SetBusy")
field(EGU, "K")
}
record(dfanout, "$(P):SetBusy")
{
field(VAL, "1")
field(OUTA, "$(P):Busy PP")
}
record(busy, "$(P):Busy")
{
}
Then some other record reading some input will set the busy back to 0 once the process is complete:
record(calcout, "$(P):CalcDone") {
field(INPA, "$(P):Blah.VAL CP")
field(CALC, "(A=1)?0:1")
field(OOPT, "Every Time")
field(OUT, "$(P):Busy.VAL PP")
}
I think only one callback can be queued though.
Cheers,
Matt
On Mar 11, 2015, at 4:42 PM, Benjamin Franksen <[email protected]> wrote:
> I guess the idea is to make a record type that can be processed multiple times
> and fire the put callback only if specific conditions are met, i.e. some
> action (involving perhaps more than one record) have finished. Something like
> the motor record.
>
> This can indeed be done with a busyRecord and asynchronous out links, but
> depending on what exactly is the desired functionality can be difficult to get
> right. I can try and dig out the database I once designed for that purpose.
>
> Cheers
> Ben
>
> Am Mittwoch, 11. März 2015, 19:01:12 schrieb Mooney, Tim M.:
>> Hi Dehong,
>>
>> I don't understand. All the EPICS records I've used behave correctly when
>> written to by a ca_put_callback, whether they use synchronous or
>> asynchronous device support. Are you writing a new record type, or trying
>> to get asynchronous device support to work with an existing record type, or
>> what?
>>
>> Tim Mooney ([email protected]) (630)252-5417
>> Software Services Group (www.aps.anl.gov)
>> Advanced Photon Source, Argonne National Lab
>>
>> ________________________________
>> From: [email protected] [[email protected]] on
>> behalf of Zhang, Dehong [[email protected]] Sent: Wednesday, March
>> 11, 2015 1:48 PM
>> To: [email protected]
>> Subject: Please help with "caput -c"
>>
>>
>> Hi Friends,
>>
>>
>> I am trying to implement an asynchronous record, would like to support
>>
>> this "put callback" feature. From the documentation, it seems I have to do
>>
>> the following:
>>
>>
>> 1. set "pp(TRUE)" for the field the user is going to "caput"
>>
>> 2. make sure only call "recGblFwdLink" (within "process") when the action is
>>
>> finished, or use a BUSY record in the end of the FLNK chain such that it
>>
>> is "DONE" only when the action is finished. -- during this process the
>> PACT
>>
>> field of the original record can go up and down.
>>
>>
>> I have been playing with all these combinations, and by adding "-w **" after
>>
>> the "caput -c", am getting inconsistent and unreliable results -- it either
>> does
>>
>> not work - calls back immediately, or waits unnecessarily long then calls
>> back.
>>
>> It rarely calls back right after the original record finishes processing and
>> declares
>>
>> the action is finished. Guess I missed something. Please spare a few
>> moments
>>
>> and advice on what exactly I need to do.
>>
>>
>> (We use 3.14.12-0.4.0, on linux machines).
>>
>>
>> Thank you very much, Best regards,
>>
>> Dehong
>
> --
> "There are two ways of constructing a software design: One way is to
> make it so simple that there are obviously no deficiencies and the other
> way is to make it so complicated that there are no obvious deficiencies.
> The first method is far more difficult." ― C.A.R. Hoare
>
>
> ________________________________
>
> Helmholtz-Zentrum Berlin für Materialien und Energie GmbH
>
> Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.
>
> Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
> Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking
>
> Sitz Berlin, AG Charlottenburg, 89 HRB 5583
>
> Postadresse:
> Hahn-Meitner-Platz 1
> D-14109 Berlin
>
> http://www.helmholtz-berlin.de
>
>
- References:
- Please help with "caput -c" Zhang, Dehong
- RE: Please help with "caput -c" Mooney, Tim M.
- Re: Please help with "caput -c" Benjamin Franksen
- Navigate by Date:
- Prev:
Re: Please help with "caput -c" Benjamin Franksen
- Next:
ioc sscan? 梁雅翔
- 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:
Re: Please help with "caput -c" Benjamin Franksen
- Next:
ioc sscan? 梁雅翔
- 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
|