What is generalTime?

generalTime is a timekeeping mechanism implemented as an EPICS device and driver support to provide and maintain clock time for an EPICS IOC. It is a replacement for drvTS in iocCore of previous EPICS versions (before 3.14.8). It is meant to provide reliable and consistent time across IOC's and combine different timekeeping methods on the same (EPICS) network. It implements a failover mechanism specially in case of hardware-assisted time providers which may fail for different reasons.


The package includes drvGeneralTime, drvDevNTPTime, drvDevVWTime and drvDevEventTime:

How to use it?

The first thing is to compile the package (for EPICS 3.14.8 and later). The supported OS at the moment is VxWorks. You need to load the driver at IOC startup in an arbitrary stage. For the NTPTime and VWTime no configuration at startup is required, they will be initilized automatically. For the EventTime a configuration command must be called at the startup to configure the IOC with the right parameters such as master/slave, clock rate, UDP ports, etc. For detailed info see the README.txt in the package and follow the section System requirements & configurations.

Timekeeping mechanism

generalTime maintains a list of prioritized clocks or time providers. When a client (i.e. EPICS record) requests the time to update its timestamp, generalTime gives the time of the highest avaiable and correct time provider (see the following figure). The idea behind is as the following: The generalTime device support has a central role. Any time-provider acts as an independent driver, therefore they can be added to existing ones like a plug-in. When a record wants to get a timestmap (i.e. when it is processed) it always uses the same method by a call to generalTime. generalTime goes through the list of the registered time providers from the highest priority and returns the first correct time. Time providers are responsible to determine whether or not they are correct.

At the moment the folowing time providers are available:


I should like to thank Jim Kowalkowsky for initial development of drvTS, Dave Thompson and Sheng Peng for priority-based clock concept, Timo Korhonen for the fruitful discussions we've had during the EventTime dvelopment, Andrew Johnson for his valuable comments.

Author: Babak Kalantari   Phone: +41 56 310 5122   Email:   Source: /afs/