EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Record loop issue
From: Luedeke Andreas <[email protected]>
To: Emmanuel Mayssat <[email protected]>
Cc: epics <[email protected]>
Date: Mon, 03 Mar 2008 10:29:09 +0100
Emmanuel Mayssat wrote:
I have been struggling with a record loop.
What is the best way to implement the following.

I have a network based Analog output device type.
I want to have the option of using that device as a TTL binary output.

I want the driver to be "smart".
Let's assume I have the following records:
ao, ai, mbbo mbbi (3-state logic high/low/undefined)

If I change the mbbo to high, the ao is set to 3.7v
If I change mbbo to low, ao is set to 1.0v
The ai is readback and mbbi is computed based on the value of ai

Now, I would like the mbbo to reflect the value of the ao
If ao is set to .5, mbbo is reset to low
If ao is set to 2.5, mbbo is undefined
If ao is set to 4.7, mbbo is set to high.

The issue is that if in the latter case mmbo is set to high, ao will be
changed from 4.7 to 3.7v. If mbbo is set to low, ao is switched back to
1v.

Is the sync'ing of ao and mbbo an unreasonable request?
If not, how would you do that?
--
Emmanuel


Hi Emmanuel,
I think this is a very common problem. I had to solve similar problems several times in the past few years.


E.g. I had two positions represented additionally as angle and displacement, each of the four can be set.
I solved it by the use of an intermediate transform record from the synApps package.
Transform has a bunch of fields (A, B, ...) with input links (INPA, INPB, ...), output calculations (CLCA, CLCB, ...) and output links (OUTA, OUTB, ...).
The feature I'm using is, that if you write field "A", then only the other output links are written (OUTB, OUTC, ...).
If your records are writing to hardware, then you would need new records to copy the data to the transform record.


You can as well use a bunch of calcout records directly, where you only write if the target will change.
This prevents loops as long as you don't have only analogue values and rounding errors in the calculations.
In your case this is probably the easier solution.


As a third choice, you could add the functionality in the device support.
If the device support is anyway specific to your hardware, then I would suggest to add this feature to your device support.
If you want to have this feature for different device supports, I would rather look into an EPICS DB solutions.



If someone else has an easier solution, please tell me :-)



Kind Regards Andreas

--
Dr. Andreas Luedeke, SLS Operations Manager, Tel:+41-56-3104002
[email protected], http://people.web.psi.ch/luedeke


References:
Record loop issue Emmanuel Mayssat

Navigate by Date:
Prev: Re: Minor VLinac compilation problem on OS X 10.5? Bertrand H.J. Biritz
Next: Re: SIS3302 Nicholas P. DiMonte
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Record loop issue Tim Mooney
Next: edm Szalata, Zenon M.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  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 ·