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  <20162017  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  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: EPICS_TIMEZONE and TZ on RTEMS
From: Michael Davidsaver <[email protected]>
To: Matt Rippa <[email protected]>
Cc: Talk EPICS Tech <[email protected]>
Date: Tue, 26 Apr 2016 07:56:01 -0400
Matt,

Could you try the attached patch for Base?  It adds an iocsh function zoneset().  For US eastern time I can use 'zoneset("EST5EDT")' and see the change reflected in generalTimeReport().

Michael


On 04/25/2016 07:13 PM, Matt Rippa wrote:
Turns out access to NVRAM variables like epics-tz only work with MOTLOAD firmware (mvme-6100).
On the PPC1-BUG firmware (mvme-2700) there isn't an obvious way.

For now, I'll have to define this in base/configure/CONFIG_SITE_ENV for each of our sites Hawaii and Chile.
For Chile, this is a terrible situation. They can't make up their mind about standard time. They will be starting daylight saving time in May.
So it looks like we'll have to rebuild EPICS Base each time their clocks change? Or choose a different BSP?

Can anyone confirm that the "epics-tz" variable is the preferred solution for the mvme-6100 (beatnik) BSP?

Thank you all for input!
-Matt

On Mon, Apr 25, 2016 at 12:45 PM, Matt Rippa <[email protected]> wrote:
Thanks. I just looked into this and src/RTEMS/base/setBootConfigFromNVRAM.c

Looks like the epics-tz variable is what I want.

-Matt

On Mon, Apr 25, 2016 at 12:36 PM, Michael Davidsaver <[email protected]> wrote:
On 04/25/2016 05:12 PM, Matt Rippa wrote:
> epicsEnvSet("TZ", "HST10")

You'll need to arrange a call to tzset() before anything happens.

http://man7.org/linux/man-pages/man3/tzset.3.html

Init() does this, but has probably already run.  As I look at it, there
doesn't seem to be a good way to set TZ for the standard rtems app...

http://bazaar.launchpad.net/~epics-core/epics-base/3.16/view/head:/src/libCom/RTEMS/rtems_init.c#L631




>From d196a5e336ea5672ca7a369346b6976b99e3f5f7 Mon Sep 17 00:00:00 2001
From: Michael Davidsaver <[email protected]>
Date: Tue, 26 Apr 2016 07:49:17 -0400
Subject: RTEMS: add zoneset iocsh function

---
 src/RTEMS/base/rtems_init.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/RTEMS/base/rtems_init.c b/src/RTEMS/base/rtems_init.c
index e89006b..ebbe9a0 100644
--- a/src/RTEMS/base/rtems_init.c
+++ b/src/RTEMS/base/rtems_init.c
@@ -433,6 +433,23 @@ static void nfsMountCallFunc(const iocshArgBuf *args)
 }
 #endif
 
+void zoneset(const char *zone)
+{
+    if(zone)
+        setenv("TZ", zone, 1);
+    else
+        unsetenv("TZ");
+    tzset();
+}
+
+static const iocshArg zonesetArg0 = {"zone string", iocshArgString};
+static const iocshArg * const zonesetArgs[1] = {&zonesetArg0};
+static const iocshFuncDef zonesetFuncDef = {"zoneset",1,zonesetArgs};
+static void zonesetCallFunc(const iocshArgBuf *args)
+{
+    zoneset(args[0].sval);
+}
+
 /*
  * Register RTEMS-specific commands
  */
@@ -443,6 +460,7 @@ static void iocshRegisterRTEMS (void)
 #ifndef OMIT_NFS_SUPPORT
     iocshRegister(&nfsMountFuncDef, nfsMountCallFunc);
 #endif
+    iocshRegister(&zonesetFuncDef, &zonesetCallFunc);
 }
 
 /*
-- 
2.1.4


Replies:
Re: EPICS_TIMEZONE and TZ on RTEMS Michael Davidsaver
References:
EPICS_TIMEZONE and TZ on RTEMS Matt Rippa
Re: EPICS_TIMEZONE and TZ on RTEMS Michael Davidsaver
Re: EPICS_TIMEZONE and TZ on RTEMS Matt Rippa
Re: EPICS_TIMEZONE and TZ on RTEMS Matt Rippa

Navigate by Date:
Prev: RE: Generating log output from areaDetector IOC Mark Rivers
Next: Re: EPICS 3.14.12.3 Build Problems with the new Ubuntu 16.04 LTS Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: EPICS_TIMEZONE and TZ on RTEMS Matt Rippa
Next: Re: EPICS_TIMEZONE and TZ on RTEMS Michael Davidsaver
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·