Subject: |
Re: Analog input record offsets |
From: |
[email protected] (Marty Kraimer) |
Date: |
Tue, 29 Nov 1994 08:08:47 -0600 |
> From [email protected] Mon Nov 28 20:22 CST 1994
> Date: Mon, 28 Nov 94 16:23:38 HST
> From: [email protected] (Nick Rees)
> To: [email protected]
> Subject: Analog input record offsets
> Content-Type> : > text>
> Content-Length: 2155
>
>
> I have a rotary encoder with a range of travel less than 360 degrees
> that I want to read into an analog input record. (Yes, its the
> telescope mount encoder). Unfortunately I have no guarantee where the
> encoder zero point is. The zero point adjustment has to be added to the
> raw value in encoder units, and then the value circularly normalised so
> the value from the encoder always lies between two accepted values.
>
> I have to write analog input device support for the hardware, so I was
> intending to do this fiddling in device support. Looking at the record
> support, it would seem that the ROFF field might be a field I could use
> - it is in digitizer units (the most convenient in this case) and is
> added to the raw value just after it is returned from device support.
> Device support would then:
>
> a. Read the value.
> b. Add ROFF
> c. Circularly normalize between the maximum and minimum possible values.
> d. Subtract ROFF (so that it can be added once again in record support).
>
> A few questions:
>
> 1. How do I set ROFF? The documentation says `it is the responsibility
> of the device support routines to use EGUF and EGUL to compute ESLO
> and ROFF'. All very well but none of the device support routines I
> have reference ROFF. (grep roff ~epics/share/src/dev/*.c returns nothing).
> What gives? Am I missing a trick somewhere?
>
In gtacs, the precurser of epics, the field roff did not appear. The
raw value was always ajjusted in the drivers so that it was a positive number
with 0 representing egul. Thus roff was not needed. For epics roff was added
for generality. Note that for gtacs the raw value was not necessarily the value
read from hardware. I guess that all new device support has followed this model.
> 2. Can I use EGUF and EGUL in ways that were not intended? (i.e. basically
> ignore them - they don't have sufficient precision). I presume so.
>
> 3. If ROFF isn't used by device support, can I just set it at
> initialization - or even in dct (this would require a change to
> aiRecord.ascii) to a specific value without breaking things?
>
You could use aoff. It is setable via dct or via Channel Access.
> I admit it is a bit ugly, but the alternative is to write a new analog
> input record for the special case of a circular encoder - and still
> have to write device support for it. If people think this is a better
> way (or have any other suggestions), do tell me.
Note that you always have the option of doing all conversions in
device support and returning a status of 2 which tells record support not
to do any conversions.
Marty Kraimer
- Navigate by Date:
- Prev:
Re: IOC Boot Time Michael Bordua
- Next:
Re: Analog input record offsets watson
- 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:
Analog input record offsets Nick Rees
- Next:
Re: Analog input record offsets watson
- 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
|