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: bug in break-point table conversion |
From: | Andrew Johnson <[email protected]> |
To: | "D. Peter Siddons" <[email protected]> |
Cc: | Rolf Keitel <[email protected]>, tech_talk <[email protected]> |
Date: | Wed, 17 May 2006 17:51:03 -0500 |
I'm not even sure when one would use the backward conversion. Isn't it always used forwards?
Andrew Johnson wrote:
Hi Rolf,
Rolf Keitel wrote:
I am not sure if I understand your message correctly. Rejecting negative slopes (in the second column) of the breakpoint table would be too limiting. One can always arrange the raw value sequence in ascending order. The engineering sequence slope is then determined by your sensor (in our case Si cryo-diodes).
If I read it properly the existing code only works if both the raw and engineering units values increase as you go down the table - otherwise you probably end up using the wrong slope for the interpolation process. However I haven't confirmed that properly so feel free to contradict me.
That is correct. If the slope is negative, the algorithm will always pick the first pair of breakpoints in the table and extrapolate linearly from there. (I checked this only for the eng>>raw conversion, but the algorithms are identical).
I agree that we should be able to support curves with negative slopes, but I was trying to avoid spending much time on adding that support myself. However while writing this reply I added the necessary tests to the parser routines to check that the engineering units values always increase and that the breaktable slopes always have the same sign.
I'm not sure yet whether you've completely converted the cvtBpt.c file, since there's another routine in there for conversions in the reverse direction - did you decide that cvtRawToEngBpt() already works with negative slopes, or not look at it at all? I don't think it should work..
I made only modifications to the cvtEngToRawBpt(), working from the assumption, that one can always arrange the table to use ascending raw values, in which case the cvtRawToEngBpt() works. Then you only have to worry about the negative slope in the engineering series for the conversion eng >> raw (We never used an EPICS tool to generate breakpoint tables).
So the parser could flatly reject descending raw sequences.
I think one should leave everything else up to the breakpoint table designer. There may even be some value of allowing both slope signs in the engineering sequence, as long as the slope in the raw series is always positive. This would allow for analogue input records to handle such things (although the same conversion in an output record would fail due to ambiguity).
- Andrew -- There is no S in exprexxo.