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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: genSub and capture monitor event |
From: | Eric Norum <[email protected]> |
To: | Emmanuel Mayssat <[email protected]> |
Cc: | epics <[email protected]> |
Date: | Thu, 3 Apr 2008 19:31:28 -0500 |
FLNK the genSub record from both PV1 and PV2. The genSub always updates PV1 and PV2.
Sound like an infinite loop? It's not, and here's why: 1) PV1 starts to process 2) PV1 sets PACT=1 3) PV1 finishes its own processing and invokes its forward link 4) The genSub record starts to process 5) genSub sets PACT=1 6) genSub writes to PV1. 7)PV1 does not process because PACT=1. 8) The genSub record writes to PV2. 9) PV2 processes and FLNKs to the genSub. 10) genSub does not process because PACT=1 11) genSub sets PACT=0 and returns 12) PV1 sets PACT=0 and returns
That's not exactly what I want... I want to execute something like that:
if PV1 is updated, process gensub and compute new PV2 if PV2 is updated, process gensub and compute new PV1 PV1 and PV2 and both inputs and outputs of gensub It is the classic loop problem, but with gensub. ;-)
The computed new PV are such that there is a equilibrium (and monitor are disabled if new value is same as old one (field(mdel,"1"))).
In other words, gensub needs to detect if it is PV1 or PV2 that updated
first, then it update the other.
-- E
On Thu, 2008-04-03 at 17:56 -0500, Eric Norum wrote:You should be able to do this by making the genSub input link a channel access link (assuming that the genSub SCAN field is Passive): field(INPA, "foobar.VAL CP")
On Apr 3, 2008, at 5:31 PM, Emmanuel Mayssat wrote:Hello,
Is there a way to detect a monitor event in a genSub routine? I believe it is possible in the sequencer with the evflag entries. But I am interested in doing that with a genSub record this time.
If gensub cannot do it, is it possible to detect a monitor event with
any other means than through the sequencer ?
--
Emmanuel
-- Eric Norum <[email protected]> Advanced Photon Source Argonne National Laboratory (630) 252-4793