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  2008  2009  2010  2011  2012  <20132014  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  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: epics input and output via records
From: Andrew Johnson <[email protected]>
To: [email protected]
Cc: Joachim Schambach <[email protected]>
Date: Mon, 7 Jan 2013 10:37:11 -0600

Hi James,

On 2013-01-07 James F Ross wrote:

> A colleague of mine and I are trying to set up an IOC for an HLT power

> supply. Basically the power supply has an internal memory that will

> remember the voltages that it was set to when it was previously turned

> off. These are changed while the IOC runs for various reasons and it is

> desirable that the IOC also remember what these voltages were.

EPICS output records were designed with this kind of issue in mind, and Mark Rivers' post about Asyn shows that it is possible. It is really up to the device support to read back the current value from the hardware within its init_record() routine, although unfortunately it must be a synchronous operation so this isn't ideal on slow interfaces (it may be easier to use an Asyn device support instead if that's the case, but ask about that here before you start a big conversion project). The record can convert the hardware's raw value back to an engineering units if desired.

If you wrote your own device support here's how the record interfaces work. The simplest example I can find is actually a bo record rather than an ao, but the principle is the same: http://www.aps.anl.gov/cgi-bin/epics/cvsweb/modules/digital/xycom/src/devBoXVme220.c?rev=1.3

In the init_record() routine the xy220_read() call sets value based on what the hardware register is currently programmed to output. If that succeeds the value is put into the RVAL field, and init_record() will return 0 which requests the record to convert RVAL to VAL. If the read failed the return value will be 2, telling the record not to do the conversion, which will leave VAL at whatever it was set to by DOL or the .db file.

HTH,

- Andrew

--

There is no such thing as a free lunch. When invited for lunch,

it is best to check if you are there to eat, or to be eaten.

-- Clive Robinson


References:
epics input and output via records James F Ross

Navigate by Date:
Prev: Re: epics input and output via records James F Ross
Next: APS Web Server upgrade in ~5 hours Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: epics input and output via records James F Ross
Next: APS Web Server upgrade in ~5 hours Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·