EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Behavior of tsLib, does TSinit get called by defaut.
From: "Thompson, David H." <[email protected]>
To: [email protected]
Date: Fri, 16 Jan 2004 12:22:12 -0500

Has the behavior of  tsLib changed in 3.14.4?

I have a hardware system for distributing time, part of the SNS timing system.  The driver for the hardware has implemented the “ER” functions that TSinit looks for.  The ErHaveReciever functions returns 2 if it is called after the hardware is configured to receive time.  I have a printf in the function so I know when it gets called.  Before, I thought, TSinit() would get called during iocInit and after that subsequent calls would do nothing, I am looking at the code.  Now, it never seems to be called.  The strange thing is that syncNTP is started and if I call TSinit after iocInit then it leaves syncNTP running.  Before I could not figure out how to have syncNTP running as a backup to the hardware time.  Once TSinit is called then the IOC does not start using the hardware time but the output of TSreport changes to make it look like it does. ( I know this because the GPS receiver that it comes from is set on GPS time which is a few seconds fast.)  The date function seems to return the NTP time.

 

 

 

 

dht-ioc1>

dht-ioc1> date

2004/01/16 11:24:33.657598

value = 27 = 0x1b

The date function returned UTC-5 Hours

dht-ioc1> TSreport

Soft timing slave

Master timing IOC dead

No clock synchronization

Clock Rate in Hertz = 1000

Sync Rate in Seconds = 10

Master communications port = 18323

Slave communications port = 18322

Total events supported = 1

Request Time Out = 250 milliseconds

Broadcast address: 0.0.0.0:0

Master address: 0.0.0.0:0

value = 0 = 0x0

 

See if syncNtp is running:

dht-ioc1> i

 

  NAME        ENTRY       TID    PRI   STATUS      PC       SP     ERRNO  DELAY

---------- ------------ -------- --- ---------- -------- -------- ------- -----

tExcTask   excTask       1dfe740   0 PEND         1c649c  1dfe650       0     0

tLogTask   logTask       1dfbdb8   0 PEND         1c649c  1dfbcd8       0     0

tShell     shell         1b51ff8   1 READY        195c38  1b51c70  1c0001     0

tTelnetd   telnetd       1b58960   2 PEND         1907bc  1b587e0       0     0

tNetTask   netTask       1b89fc8  50 PEND         1907bc  1b89f08       0     0

snsUtilEven198793c       193e198  99 PEND+T       1c649c  193e0b8       0   300

tPortmapd  portmapd      1b573c0 100 PEND         1907bc  1b57240      16     0

syncNTP    19d6128       1945e38 109 DELAY        1951c8  1945d50  320001   220

cbHigh     19d6128       194b700 128 PEND         1907bc  194b630       0     0

……

value = 0 = 0x0

 

Now, call TSinit.

 

dht-ioc1> TSinit

iocClockRegister: iocClock already initialized

ErHaveReceiver() returns 2

value = 0 = 0x0

 

That called ErHaveReceiver in the driver.

 

dht-ioc1> TSreport

Direct timing slave

Master timing IOC dead

NTP sync with unix server

Clock Rate in Hertz = 1000

Sync Rate in Seconds = 10

Master communications port = 18323

Slave communications port = 18322

Total events supported = 2

Request Time Out = 250 milliseconds

Broadcast address: 160.91.227.255:18323

Master address: 0.0.0.0:0

Event system has time directly available

value = 0 = 0x0

 

Date still returns UTC

dht-ioc1> date

2004/01/16 11:37:33.400696

 

 

If I call tsInit before iocInit then date returns GPS time. (13 seconds fast. )

 

## This drvTS initializer is needed if the IOC has a hardware event system

TSinit

ErHaveReceiver() returns 2

value = 0 = 0x0

#v124sConfig 0, 0x9000, 0x3a, 7, 0.0

 

cd startup

value = 0 = 0x0

iocInit()

############################################################################

###  EPICS IOC CORE built on Nov 21 2003

###  EPICS R3.14.4 $$Name:  $$ $$Date: 2003/10/18 17:42:28 $$

############################################################################

Starting iocInit

value = 0 = 0x0

 

dht-ioc1> iocInit: All initialization complete

 

dht-ioc1> date

2004/01/16 12:10:14.312417

value = 27 = 0x1b

As you would expect:

ht-ioc1> TSreport

Direct timing slave

Master timing IOC dead

NTP sync with unix server

Clock Rate in Hertz = 1000

Sync Rate in Seconds = 10

Master communications port = 18323

Slave communications port = 18322

Total events supported = 2

Request Time Out = 250 milliseconds

Broadcast address: 160.91.227.255:18323

Master address: 0.0.0.0:0

Event system has time directly available

 

and syncNTP is NOT running.

 

The question is: Do I have to call TSinit to use the hardware time? Should the driver do that?  It looks for all in the world, looking at the code, that TSinit should get called somewhere from iocInit, at the very least when the first time stamp is required, but it does not seem to.  I thought that TSinit started syncNTP.

 

Am I missing something?

 


Navigate by Date:
Prev: Can epics live simpler? Liyu, Andrei
Next: RE: EPICS time Mark Rivers
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Can epics live simpler? Liyu, Andrei
Next: ? initHookRegister() Liyu, Andrei
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·