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
<2007>
2008
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
<2007>
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|