Experimental Physics and Industrial Control System
Dehong Zhang wrote:
Hi,
Could somebody please advice on how to initialize a multi-element
field when calling dbLoadRecords?
Thanks and best regards,
Dehong
I think this can't be done, because at the time dbLoadRecords() runs,
the memory that will eventually hold array values has not been allocated.
(Even if the memory were allocated, I think there is no code in
dbStaticLib to write to it. You must use run-time database access.)
I think the earliest time you can write array values is after database
initialization (i.e., initHookAfterInitDatabase).
The easiest and closest thing I know of to what you want would be to use
autosave to restore the array values. You can do this whether or not
autosave is also used to save those values (i.e., you can write an
autosave .sav file by hand).
Here's an example .sav file that will restore a two-element array,
(assuming that autosave is included in the ioc's software).
# save/restore V4.9
xxx:myArray @array@ { "1.0" "2.3" }
<END>
(Note the above file must end with '\n' or "\r\n".)
If the above file is named 'myArrays.sav', and is located in the directory,
<myIocDir>, you can get autosave to restore it by including the following
commands in st.cmd, before iocInit:
set_savefile_path("<myIocDir>","")
set_pass1_restoreFile("myArrays.sav")
Here's a link to the autosave module:
http://www.aps.anl.gov/bcda/synApps/autosave/autosave.html
--
Tim Mooney ([email protected]) (630)252-5417
Beamline Controls & Data Acquisition Group
Advanced Photon Source, Argonne National Lab.
- Replies:
- Re: Initialize multi-element field Benjamin Franksen
- References:
- Initialize multi-element field Dehong Zhang
- Navigate by Date:
- Prev:
Re: calc record LINK error Emmanuel Mayssat
- Next:
Re: TTL output with soft IOC on Linux Jiro Fujita
- 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:
Initialize multi-element field Dehong Zhang
- Next:
Re: Initialize multi-element field Benjamin Franksen
- 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