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  <20142015  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  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Power PMAC and EPICS Time stamps
From: Choon Lim <[email protected]>
To: [email protected]
Date: Tue, 29 Jul 2014 15:24:44 -0700
Hello, 

We use Power PMAC(s) for Insertion Device motion controls.  soft IOCs run on the Power PMACs. 

As most of you already know, the Power PMAC runs Linux with a Xenomai real time kernel. 

We have been trying to determine why the EPICS time stamps have been incorrect.

We determined that after a reboot of the machine:
- clock_gettime(CLOCK_REALTIME, &clockNow) functions would return the time since reboot.  This does not correlate with the Xenomai API which states it should be the time since EPOCH 

- As a result when the first IOC is launched after a reboot, the following logic from /src/libCom/osi/osiClockTime.c is invoked 
    if (!ClockTimePvt.synchronized &&
        clockNow.tv_sec < POSIX_TIME_AT_EPICS_EPOCH) {
        clockNow.tv_sec = POSIX_TIME_AT_EPICS_EPOCH + 86400;
        clockNow.tv_nsec = 0;
        clock_settime(CLOCK_REALTIME, &clockNow);
        errlogPrintf("WARNING: OS Clock time was read before being set.\n"
            "Using 1990-01-02 00:00:00.000000 UTC\n");
    }

- This then sets the time to 1990-01-02 after which subsequent IOCs use this time 

- Strangely the time() function in <time.h> returns the correct time regardless of whether the machine has been rebooted. 

- I have contacted Delta Tau and asked them if they know about this phenomenon

- As a "quick" fix to the issue, I am calling clock_settime() with the value of time() after a reboot, however I do not think this allows for NTP corrections.  

I hope this helps anyone else out there who is enjoying the "nuances" or the Power PMAC. 

Choon  

Navigate by Date:
Prev: epicsqt on arm board Hansen
Next: RE: EPICS on VxWorks6.9 Amit Chauhan
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: 回复: RE: 回复:epicsqt on arm board Andrew Rhyder
Next: Recommended Control HWs for High Voltage Platform Jeong Han Lee
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  <20142015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 17 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·