EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: RE: ai, soft channel, and breakpoint table
From: "Allison, Stephanie" <[email protected]>
To: "John Dobbins" <[email protected]>, "EPICS Tech-Talk" <[email protected]>
Date: Tue, 17 Jul 2007 17:32:34 -0700
Hi John, 

> Is it possible to use a breakpoint table in an ai record to 
> convert the output 
> of another ai record (without loss of resolution)?
> 
> I have an ai record for which device support retrieves a 
> floating point value 
> from hardware and puts it directly into the VAL field.
> 
> I would like to use a breakpoint table in a second ai record 
> to convert the 
> reading of the first record - which (as I understand it) 
> would require me to use 
>   a "Raw Soft Channel". Will a "Raw Soft Channel" ai record, 
> in reading a value 
> into RVAL, convert it to an integer (with a loss of resolution)?
> 
> Alternatives?

I don't know about using a second ai record.  In my case, I ended up using a subroutine record - perhaps a bit ugly, probably somebody knows something better:

long yourSub(struct subRecord *psub)
{
  /*
   * Inputs:
   *          A = Your input
   *          B = Breakpoint Table Index
   *     C to G = spares
   *       DPVT = Pointer to Breakpoint Table
   * Outputs:
   *          H = Value from the Breakpoint Table
   *          I = Spare
   *          J = Previous Breakpoint Table Index
   *       DPVT = Pointer to Breakpoint Table
   *          K = Spare
   *          L = Last Breakpoint
   *        VAL = Your output
   */
  short lbrk;  /* Last breakpoint */

    if (psub->j != psub->b)
    {
      psub->j = psub->b;
      psub->dpvt = 0;
    }
    lbrk    = psub->l;
    psub->h = psub->a;
    if (cvtRawToEngBpt(&psub->h, (short)psub->j, 0,
                       &psub->dpvt, &lbrk)) return -1;
    psub->l   = lbrk;
    psub->val = psub->h;
  return 0;
}

Stephanie Allison


References:
ai, soft channel, and breakpoint table John Dobbins

Navigate by Date:
Prev: Re: MEDM enum not displaying correctly? Benjamin Franksen
Next: RE: IPac driver organisation Denison, PN (Peter)
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: ai, soft channel, and breakpoint table John Dobbins
Next: Re: ai, soft channel, and breakpoint table Martin L. Smith
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  <20072008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Nov 2011 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·