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  2013  2014  2015  2016  2017  2018  2019  <20202021  2022  2023  2024  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: get the timestamp of a record as a human-readable string and restore it after rebooting
From: "Hu, Yong via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 18 Aug 2020 23:00:59 +0000

Hello everyone,

 

Since the field .TIME is internal to a record (e.g. recordA), it seems not straightforward for a string record (e.g. recordB) to directly get the timestamp of recordA as a human-readable string, although it is straightforward for a Python program to put a record’s timestamp as a string.

 

I managed to use “Soft Timestamp” together with “TSEL” to get the timestamp of a not-on-the-same-IOC record as a human-readable string. See below:

record(calcout,"recordA -Calc_") {

   field(INPA,"recordA CP")

    field(CALC,"1")

    field(OOPT,"Transition To Zero")

    field(OUT, "recordB.PROC")

}

 

record(stringin, "recordB")

{

    field(DTYP,"Soft Timestamp")

field(PINI,"YES")

#without TSEL, recordB will not be exactly the same as recordA’s timestamp

    field(TSEL,"recordA.TIME")

    field(INP, "@%Y-%m-%d %H:%M:%S.%f")

    info(autosaveFields_pass0, "VAL")

}

 

recordA is a bi record running on another IOC (that is why I use CP in INPA). I want to use recordB to latch the timestamp of recordA when recordA’s value goes from 1 to 0. Everything seems working as expected. However, there is one problem with autosave. After the IOC is rebooted, the value of recordB is <undefined>, it is not restored to its saved value although I see the saved value “2020-08-15 01:18:55.236900451” in the *_pass0.sav file before I reboot the IOC. I also tried to use pass1, the same result <undefined>.

$ caget -a recordB

recordB     <undefined> <undefined>

 

I see some errors during the rebooting. I guess the reason why I get “dbGetTimeStamp failed” is that the CA link is not established yet before initial process (PINI=YES). However, when I look through the code https://github.com/epics-base/epics-base/blob/3.15/src/ioc/misc/iocInit.c, dbCaLinkInit() is indeed before initialProcess().

reboot_restore: entry for file 'settings_pass0.sav'

reboot_restore: Found filename 'settings_pass0.sav' in restoreFileList.

*** restoring from './as/save/settings_pass0.sav' at initHookState 6 (before record/device init) ***

reboot_restore: done with file 'settings_pass0.sav'

recGblGetTimeStamp: dbGetTimeStamp failed, recorddB.TSEL = recordA

 

How do I solve this problem? Any suggestions are appreciated!

I am using Base-3.15.6-2 and autosave-5.9 if versions matter.

 

Thanks,

Yong Hu


Replies:
Re: get the timestamp of a record as a human-readable string and restore it after rebooting Mooney, Tim M. via Tech-talk

Navigate by Date:
Prev: ADEiger 1.8 Miceli, Antonino via Tech-talk
Next: RE: ADPilatus and camserver version Ivashkevych, Oksana via Tech-talk
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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: ADEiger 1.8 Yendell, Gary (DLSLtd, RAL, LSCI) via Tech-talk
Next: Re: get the timestamp of a record as a human-readable string and restore it after rebooting Mooney, Tim M. via Tech-talk
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  <20202021  2022  2023  2024 
ANJ, 19 Aug 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·