EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  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  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Skip updating an output link in aSub ?
From: Andrew Johnson <[email protected]>
To: Lingyun Yang <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Thu, 14 Jan 2016 12:29:14 -0600
On 01/14/2016 11:59 AM, Lingyun Yang wrote:
> This would be the type of solution that I am looking for. But I am not
> quite familiar with the device support yet.

To be strictly correct, this is not device support.

> What I am doing now is define my data analysis function, register and
> put it in dbd file.
> Is this dbPutLink called in my data analysis function ? I guess not.
> Or I duplicate the device support work done by src/rec/aSubRecord.c or
> even the dbd file, but change its process to update dbPutLink according
> to my mask ?

You put the necessary dbPutLink() calls in your aSubRecord subroutine,
the one whose name appears in the SNAM field of the record, so yes
that's in your data analysis function. You should not change the record
type code at all; by returning a non-zero value from your analysis
function you will be telling the record not to do the puts, because your
code has already done them.

Now the code in the record itself has been optimized to put all the
output links at once in a single loop:

>         for (i = 0; i < NUM_ARGS; i++)
>             dbPutLink(&(&prec->outa)[i], (&prec->ftva)[i],
>                 (&prec->vala)[i], (&prec->neva)[i]);

In your case though you may want to do each put separately when you have
finished calculating each output field's value. The result might look
something like this:

    /* Calculate vala ... */

    dbPutLink(&prec->outa, prec->ftva, prec->vala, prec->neva);

    /* Calculate valb and valc ... */

    if (doAction) {
        dbPutLink(&prec->outb, prec->ftvb, prec->valb, prec->nevb);
        dbPutLink(&prec->outc, prec->ftvc, prec->valc, prec->nevd);
    }

    /* Calculate vald ... */

    dbPutLink(&prec->outd, prec->ftvd, prec->vald, prec->nevc);

    return -1; /* Don't put output links */

- Andrew

-- 
There are only two hard problems in distributed systems:
  2. Exactly-once delivery
  1. Guaranteed order of messages
  2. Exactly-once delivery
 -- Mathias Verraes

References:
Skip updating an output link in aSub ? Lingyun Yang
Re: Skip updating an output link in aSub ? Michael Davidsaver
Re: Skip updating an output link in aSub ? Andrew Johnson
Re: Skip updating an output link in aSub ? Lingyun Yang
Re: Skip updating an output link in aSub ? Andrew Johnson

Navigate by Date:
Prev: Re: areaDetector: ADBinX/Y and ADSizeX/Y interactions Phil Atkin
Next: RE: areaDetector: ADBinX/Y and ADSizeX/Y interactions Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Skip updating an output link in aSub ? Andrew Johnson
Next: Re: Skip updating an output link in aSub ? Roehrig, Christian
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·