1 / 10

GeneralTime Proposal Status at SNS and Ideas for EPICS base

GeneralTime Proposal Status at SNS and Ideas for EPICS base. David Thompson Sheng Peng Kay-Uwe Kasemir. Times used in EPICS. epicsTimeGetCurrent() “Now”, used to schedule tasks, delays, timeouts, … epicsTimeGetEvent(event number) Used to time-stamp records. Event number might select …

kasie
Télécharger la présentation

GeneralTime Proposal Status at SNS and Ideas for EPICS base

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GeneralTime ProposalStatus at SNSand Ideas for EPICS base David Thompson Sheng Peng Kay-Uwe Kasemir

  2. Times used in EPICS • epicsTimeGetCurrent()“Now”, used to schedule tasks, delays, timeouts, … • epicsTimeGetEvent(event number)Used to time-stamp records. Event number might select … • “Now” (typically event # 0) • Time of last beam pulse • Time of last XYZ event • … • Different implementations for RTEMS, Posix, Win32, … almost all of which ignore the event number andsimply pick the ‘system’ time from the OSi.e. GetCurrent() == GetEvent().

  3. iocClock • … implements epicsTimeGetCurrent()/GetEvent() for vxWorks as func. ptr. table. • Installs default handlers which call vxWorks’ NTP client routines. • We found some possible errors in the ‘ticksToSkip’ code. • iocClockRegister((*getCurrent)(), (*getEvent)())allows users to install routines that access site-specific timing hardware • Only one user can register. • This will hide iocClock’s NTP implementation.

  4. drvTS • Installs its GetCurrent()/GetEvent() routines via iocClockRegister(). • Supports • NTP from boot host (different code from iocClock) • Custom soft time master & soft time slave protocol • Hooks for hardware timing system • Problem: No fall-back • For example, hardware timing system plug-in can’t tell drvTS to temporarily use NTP, or fall back further to system clock when NTP host is also inaccessible. • Complexity

  5. New: generalTime as currently used at SNS • Installs its GetCurrent()/GetEvent() routines via iocClockRegister(). • Supports various time source plug-ins, currently: • SNS hardware (utility board), vxWorks clock, NTP, CMOS clock. • Prioritizes the time sources • Always selects the “best available” time source, depending on whether an event time or the current time is requested. • When timing source reports error (no carrier, no connection to NTP host, …), the next available source is used. • One can add a custom timing source and still benefit from the existing timing sources as a fall-back.

  6. API (extending iocClockRegister) • General time calls: iocClockRegister(). • A time driver calls: generalTimeTpRegister(). Arguments: • Tcp_priority: Priority of current time function. • getCurrent: Pointer to current time function in your driver. • syncTime: A pointer to a function that general time calls to synchronize the time in the driver if needed. • Tep_priority: Priority of event time function. • getEvent: The event time function in your driver.

  7. API (Continued) • When an EPICS API function requests a current time or an event time, general time calls registered time functions in order of priority. • When a time driver returns OK the search for the time is stopped and that time is returned to the Epics system caller. • If the time function returns ERROR then the next lower priority driver is called. • The lowest priority time is the system time which should always be available, even if it is wrong.

  8. General time features: • General time is an Epics driver with device support. • The drvGeneralTime report function reports status and a list of time providers. • Device support provides string and ai record support for status of current time providers for both event time and current time lists.

  9. Idea behind generalTime generalTime: Implements epicsTimeGetCurrent &epicsTimeGetEvent Using a prioritized list of time sources GeneralTime returns the highest priority time source available This is completely transparent to epics time and record processing functions. drvHWTimingSystem Each of the time sources also supports dbior and AI records, returning seconds since 1/1/1990 and stat/sevr for diagnostics displays. drvSystemTime devSystemTime drvTimeNTP devTimeNTP drvTimeCMOS devTimeCMOS

  10. Proposal for EPICS base • Instead of iocClock(single Current/Event routine, user replaceable),use generalTime(prioritized list of routines, user configurable). • Don’t limit it to vxWorks. Make generalTime the common code. Timing sources are OS specific, with a “System clock” timing source provided for all OS as the default. • Maybe provide soft time slave timing source for all OS? Then drvTS can be simplified to be soft time master.

More Related