EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Scaling Database entries
From: Kay-Uwe Kasemir <[email protected]>
To: David Dudley <[email protected]>
Cc: [email protected]
Date: Tue, 14 Nov 2006 10:13:05 -0500
Hi David:

In the convert()'s
        precord->eslo = (eguf - egul)/(deviceHigh - deviceLow);
        precord->eoff = (deviceHigh*egul - deviceLow*eguf)/
                        (deviceHigh - deviceLow);

the deviceLow, deviceHigh is indeed fixed.


This handles the case where you write device support for a 0..10V ADC,
that happens to return values from deviceLow=0x0000 for 0V to deviceHigh=0xFFFF for 10V.


Now 'users' can conveniently set the records' LINR=LINEAR,
with EGUL/EGUF/EGU = 0/10/V to see the voltage, or
with EGUL/EGUF/EGU = 2/5/m in case your 0..10V range
represents a liquid level sensor that maps 0V=2m, 10V=5meters,
and so on.

If the deviceLow/deviceHigh is not fixed,
you have to use the LINR=SLOPE method,
and set the EOFF and ESLO fields of the record yourself.
So then you have full control over the rval-to-val conversion,
but instead of configuring something like
{RAWLOW, RAWHIGH, EGUL, EGUF},
which might be more convenient,
you have to compute the appropriate EOFF and ESLO values.

-Kay


On Nov 14, 2006, at 09:37 , David Dudley wrote:


Two point scaling I understand. What I haven't figured yet is where I put it in.

Where(how) do I set the deviceHigh and deviceLow variables, or is that expected in the device driver? And if it is in the device driver, does that mean that I'm going to have to have a separate device entry for each device that has a different dynamic range?

Dynamic range calculations are not handled inside EPICS?

I've got a number of different dynamic ranges for the different devices here, do they all have to be separately scaled inside the device driver to a standard range, or can EPICS be set to adjust for the dynamic ranges?

Most of the software (make that *all*) I've used previously had the ability to have the RAWLOW and RAWHIGH values set, and they they did the scaling themselves. Seems an omission if EPICS can't do that?

David

"Mark Rivers" <[email protected]> 11/13/06 8:22 PM >>>
Device support must have a "convert" routine that does a calculation like the following to compute .ESLO and .EOFF

        precord->eslo = (eguf - egul)/(deviceHigh - deviceLow);
        precord->eoff = (deviceHigh*egul - deviceLow*eguf)/
                        (deviceHigh - deviceLow);

Mark


________________________________


From: David Dudley [mailto:[email protected]]
Sent: Mon 11/13/2006 8:07 PM
To: [email protected]
Subject: Scaling Database entries



OK guys,

My modbus driver is starting to work, and now I'm linking up with some of the PLC's in the plant. Now, I've started working on building the database for the first site.

Here's my question:

I've got some AI signals that come from one of the PLCs. Raw values on some are scaled 0-32000, while others are scaled 800-32000, and others have raw values from -32768-32767. I see the definitions for the EGUL and EGUF values, but how do I set the RAW input ranges? Also, I've got some flow meter values that have to be scaled from linear to square root values..

David Dudley
City of Corpus Christi






<David Dudley.vcf>


References:
RE: Scaling Database entries David Dudley

Navigate by Date:
Prev: devSNMP: Thread error? Bertrand H.J. Biritz
Next: Re: devSNMP: Thread error? Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Scaling Database entries David Dudley
Next: Re: Scaling Database entries Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·