The time(0) will return the number of seconds that the IOC has been
running unless you set it. Unless the ioc has been up for a year ctime
would convert that into a date in 1970 since time(0) is 1/1/70 00:00
GMT.
Out kernels make a call to sntpTimeGet() and then a call to
clock_settime() before running the startup script. That gets it right
for a while but it will drift. You can make these calls from the top of
the startup script so long as you malloc a block of memory to hold a
struct timespec to pass to the two calls.
The generalTime driver may do the same thing.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Kevin M. Peterson
Sent: Tuesday, July 31, 2007 12:28 PM
To: tech-talk
Subject: VxWorks time()
After upgrading an ioc from:
Processor: MVME2700
BSP: mv2700-asd8_nodns
EPICS version: R3.13.9
synApps version: 4-6
to:
Processor: MVME5100
BSP: mv5100-asd8_nodns
EPICS version: R3.14.8.2
synApps version: 5_2_test
a sequence program that writes the current date and time
into a file no longer logs the correct time.
The time on the ioc is correct:
lga> date
2007/07/31 11:14:56.572507
value = 27 = 0x1b
lga>
but the method used by the sequence program which worked
before the upgrade, no longer behaves properly:
lga> systime = time(0)
systime = 0x1e1a8d10: value = 423436 = 0x6760c
lga> printf("%s",ctime(&systime))
MON JAN 05 15:37:16 1970
value = 25 = 0x19
lga>
Originally I thought that something might have changed in the
sequencer but since I see the same incorrect behavior on the
VxWorks console I'm forced to look elsewhere for the problem.
The VxWorks documentation says time() should return the current
time if passed NULL (which the sequence program does). Is time()
broken in mv5100-asd_nodns? If not, where else can I look for a
potential misconfiguration?
Thanks ahead of time,
Kevin
- Replies:
- Re: VxWorks time() Ralph Lange
- References:
- VxWorks time() Kevin M. Peterson
- Navigate by Date:
- Prev:
RE: VxWorks time() Mark Rivers
- Next:
Embedded EPICS IOC David DeBonis
- 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:
RE: VxWorks time() Mark Rivers
- Next:
Re: VxWorks time() Ralph Lange
- 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
|