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: pyEpics time stamps
From: Eric Norum <[email protected]>
To: EPICS mailing list <[email protected]>
Date: Mon, 12 May 2014 13:48:21 -0700
I’m seeing something odd with time stamps in my pyEpics application.   Am I doing something wrong or is there a problem with how pyEpics handles time stamps?

Step 1 —  check local time
enorum@b04lxioc02 213> date
Mon May 12 13:37:31 PDT 2014

Step 2 —  confirm that the record time stamps are as expected:
enorum@b04lxioc02 214> camonitor SR1:BCM:ADC_WF | sed '/10496.*/s///'
SR1:BCM:ADC_WF 2014-05-12 13:37:33.666516 
SR1:BCM:ADC_WF 2014-05-12 13:37:34.666129 
SR1:BCM:ADC_WF 2014-05-12 13:37:35.665747 
SR1:BCM:ADC_WF 2014-05-12 13:37:36.665359 

Step 3 —  check what pyEpics reports:
enorum@b04lxioc02 215> python b.py
2014-05-12 11:37:40
2014-05-12 18:37:40
2014-05-12 11:37:41
2014-05-12 18:37:41




Times are two hours off, both UTC and local (we are now 7 hours behind UTC).



Here’s the pyEpics script that printed the above — it’s stripped out of a somewhat larger application just to show the problem
from epics import PV
import argparse
import math
import sys
import time

def checkTimestamp(pvname=None, timestamp=None, **kws):
    sec = math.floor(timestamp)
    tm = time.localtime(sec)
    print '%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d' % (tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec)
    tm = time.gmtime(sec)
    print '%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d' % (tm.tm_year, tm.tm_mon, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec)

pvADC = PV('SR1:BCM:ADC_WF', form='time', callback=checkTimestamp)
time.sleep(3)


-- 


Replies:
Re: pyEpics time stamps Eric Norum

Navigate by Date:
Prev: Re: writing scan data to file via CSS Kasemir, Kay
Next: Re: pyEpics time stamps Eric Norum
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: writing scan data to file via CSS Kasemir, Kay
Next: Re: pyEpics time stamps Eric Norum
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 ·