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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Scaling Database entries |
From: | Dirk Zimoch <[email protected]> |
To: | Andrew Johnson <[email protected]> |
Cc: | [email protected] |
Date: | Thu, 16 Nov 2006 09:37:13 +0100 |
Dirk Zimoch wrote:
if you driver does not set ESLO and EOFF, you can set it in your db. Calculate manually what to set. I did the same with StreamDevice.
...
Don't forget to set LINR to "LINEAR", of course.
If you want to set ESLO and EOFF yourself, you should set LINR to "SLOPE" rather than "LINEAR" or there's a danger the device support will overwrite your values if someone modifies any of the conversion fields. StreamDevice might not do so if it doesn't have a special_linconv routine, but then it's not following the full ai/ao standard. Most analog device supports will overwrite ESLO and EOFF; by relying on non- standard behaviour you're making it harder for someone to replace hardware using a StreamDevice interface with some other device, because they now have to change more than just the DTYP and INP/OUT field of their database records when they move (and they might not realize that).
StreamDevice should have some way for the author of a protocol file to specify what the device's raw range actually is for analog records, and it should perform the calculation of ESLO and EOFF from that raw range and the EGUL+EGUF pair.
The other option you might want to support if you don't already would be to control whether any conversions get done at all - many instruments return engineering units anyway, and that's why the analog records allow the device layer to set the VAL field directly and return 2. This is used a lot for GPIB instrumentation.
-- Dr. Dirk Zimoch Swiss Light Source Computing and Controls Paul Scherrer Institut phone +41 56 310 5182 fax +41 56 310 4413