Here are a couple of ways to handle this.
Use autosave. The IOC will save the output voltage any time it is changed. When the IOC reboots it will restore the last saved settings, which should
match the values in the power supply.
Use an asyn driver with standard asyn device support. The asyn device support for output records reads the value from the driver and if the read
returns success it sets the VAL field of the output record to this value. The driver should return success on this initial read if it was able to successfully read the power supply at initialization.
From: firstname.lastname@example.org [mailto:email@example.com]
On Behalf Of James F Ross
Sent: Monday, January 07, 2013 9:20 AM
To: EPICS Tech Talk; Joachim Schambach
Subject: epics input and output via records
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.
What is currently happening is if the IOC has to be restarted, it loads the default setpoint values in the db files and we lose the current settings in the power supply. We have a workaround in place, setting the values by DOL fields in the output records,
but we are having trouble using anything other than a hard value (like 5.0 rather than a variable). What would be ideal is if the IOC on start up could read the value from the power supply and output that value via the DOL. Is there a way in, say, an ao
record to get the value that was read in by a corresponding ai record and output that value? How do you call one record in another within the db file?
An alternative would be to prevent the IOC from changing any values at all on start up... For this approach if anyone could let us know what field types and records are generally used to change the value of a variable, that would help us hunt down what to
change in the db files.
If anyone also has any suggestions on how this kind of thing is most commonly handled in EPICS that would be helpful as well.
Let me know if my question is confusing and I can try to clarify.