epics-modules / iocStats

EPICS IOC Status and Control
Other
12 stars 39 forks source link

TIMEZONE was renamed to TZ in the latest EPICS base #37

Closed jeonghanlee closed 4 years ago

jeonghanlee commented 4 years ago

With EPICS 7.0.3.1[1] (I don't know when TZ was introduced.), TIMEZONE was renamed to TZ. So the iocAdminSoft substitutions [2] file should be updated according to them if one would like to use iocStats vanilla substitutions. The additional changes may be necessary in [3-8].

[1] https://github.com/epics-base/epics-base/blob/7.0/modules/libcom/src/env/envDefs.h#L66 [2] https://github.com/epics-modules/iocStats/blob/master/iocAdmin/Db/iocAdminSoft.substitutions#L30 [3] https://github.com/epics-modules/iocStats/blob/master/iocAdmin/Db/iocAdminRTEMS.substitutions#L40 [4] https://github.com/epics-modules/iocStats/blob/master/iocAdmin/Db/iocAdminVxWorks.substitutions#L40 [5] https://github.com/epics-modules/iocStats/blob/master/op/ui/autoconvert/ioc_stats_epics_env.ui#L485 [6] op/adl/ioc_stats_epics_env.adl [7] op/opi/ioc_stats_epics_env.opi [8] iocAdmin/srcDisplay/ioc_stats_epics_env.edl

anjohnson commented 4 years ago

The EPICS_TIMEZONE environment parameter was only required on VxWorks systems, although RTEMS could use it. It had no effect at all on other OSs, so probably shouldn't have been shown at all for soft IOCs. EPICS_TZ isn't a direct rename of EPICS_TIMEZONE, it's a functionally better replacement for it, and first appeared in Base 3.15.7 and EPICS 7.0.3.1.

On VxWorks systems the EPICS_TZ value is used to set the TIMEZONE variable that the OS needs to convert a Posix time into a string. Previously the EPICS_TIMEZONE value was copied directly into TIMEZONE when the latter wasn't already defined. On RTEMS systems EPICS_TZ is now copied (but won't over-write) the TZ environment variable which that OS needs for time conversions.

@jeonghanlee What was the effect of this change? Did iocStats crash, put the $(IOC):TIMEZONE record in an alarm state, or was its value just empty?

jeonghanlee commented 4 years ago

No, iocStats returns the error message for TIMEZONE. I didn't copy the warning message exactly, which will be printed out in the ioc console. However, it may be this [1].

I created the ESS specific substitutions, and replaced EPICS_TIMEZONE with EPICS_TZ as follows: https://github.com/icshwi/e3-iocStats/blob/master/template/iocAdminSoft-ess.substitutions#L36 Then, the error message was gone.

I think, it doesn't matter "copy" object between platforms, because all entries were defined in https://github.com/epics-base/epics-base/blob/7.0/modules/libcom/src/env/envDefs.h#L78 And iocStats uses it internally that object [2] to match with the substitutions definitions [3]. However, this conclusion was done after short code reviewing between EPICS base and iocStats. I didn't do any serious test or verification on my naive conclusion.

And the PV $(IOCNAME):TZ is empty with the ESS specific iocAdminSoft-ess.substitutions.

[1] https://github.com/epics-modules/iocStats/blob/master/devIocStats/devIocStatsString.c#L254 [2] https://github.com/epics-modules/iocStats/blob/master/devIocStats/devIocStatsString.c#L263 [3] https://github.com/epics-modules/iocStats/blob/master/iocAdmin/Db/iocAdminSoft.substitutions#L22-L33

jeonghanlee commented 4 years ago

That is the error message after iocInit

Error (511,511) PV: ServiceTestIOC-IocStats:TIMEZONE devStringinEnvVar (init_record) Illegal INP parm field