I have an application with several tasks that utilizes the SysTimeRtc* family of functions. The initial problem I encountered was that the SysTimeRtcConvertHighResToLocal function would not properly convert the UTC time to local time. The converted time that was being returned was always for the UTC time zone.
During the debugging process I discovered that the SysTimeRtcGetTimezone function was returning the timezone as UTC even though the PLC was properly configured with the appropriate time zone.
Digging further, I narrowed the issue down to the runtime somehow getting corrupted when multiple tasks call the SysTimeRtc* functions concurrently. Specifically, calling SysTimeRtcGetTimezone from multiple tasks causes the runtime to raise an AccessViolation exception.
Once corrupted, the runtime needs to be restarted. No issues with UTC to local timezone conversations are encountered with only one task using the functions.
My question is whether or not the SysTimeRtc* functions are expected to be reentrant and if not is there documentation specifying which functions are or are not thread-safe.
seems like we are facing a similar problem using the SysTimeRtcGetTimezone function in multiple tasks, resulting in access violations. Did you solve it?
Log in to post a comment.