View Issue Details

IDProjectCategoryView StatusLast Update
000695910000-006: MappingsSpecpublic2021-08-31 16:42
ReporterBjarneBostrom Assigned ToRandy Armstrong  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Summary0006959: Picoseconds truncation in DataValue for DevelopmentPlatform that do not support full resolution not defined in the spec
Description

The https://reference.opcfoundation.org/Core/docs/Part6/#5.2.2.5 says for DateTime (Btw, as the time of writing this, the link actually shows me the top of the page, not the section):
"...
Not all DevelopmentPlatforms will be able to represent the full range of dates and times that can be represented with this DataEncoding. For example, the UNIX time_t structure only has a 1 second resolution and cannot represent dates prior to 1970. For this reason, a number of rules shall be applied when dealing with date/time values that exceed the dynamic range of a DevelopmentPlatform.

...

A decoder shall truncate the value if a decoder encounters a DateTime value with a resolution that is greater than the resolution supported on the DevelopmentPlatform.
..."

That by itself is good and clear to me. However, what is not defined is how this affects things when the DateTimes are used within DataValue. The DataValue contains the 10s of picoseconds fields in addition to the DateTime fields and this provides scenarios not defined in the specification:

  1. IF a DevelopmentPlatform cannot support full range of DateTime, that should to me indicate that a decoder can/must simply skip the picoseconds (like, they do not exactly make sense, since the Datetime itself was already truncated). However this is not defined (as far as I can see) in the spec.

  2. IF a DevelopmentPlatform can support full range of DateTime, but cannot for the 10s of picoseconds? The specification doesn't say anything regarding this, but what if the "resolution of time" on a DevelopmentPlatform is 1nanosecond. Thus e.g. a Client writing a DataValue with picoseconds included would receive the same DateTime back, but the picoseconds part would/could/should be truncated? If this is the case, the Part 6 section 5.2.2.17 should be modified to add e.g. "See section 5.2.2.5 for truncation of DateTime if a DevelopmentPlatform doesn't support full range. A Decoder is allowed to truncate the picoseconds values if the resolution of time it supports is between 100nanoseconds and 10picoseconds" or something like that.

P.S. the "DevelopmentPlatform" support is here taken to basically mean "whatever an SDK vendor choses to use", since every app via raw binary is able to receive the value, thus via raw binary, it "should be" always be possible to support full range, though it might not be as practical to use so the truncation rules are sort of a good thing so "native" types can be used.

TagsNo tags attached.
Commit Version
Fix Due Date

Relationships

related to 0006811 closedRandy Armstrong JSON encoding of DateTime needs clarification 

Activities

Zbynek Zahradnik

2021-05-20 15:19

developer   ~0014414

Bjarne asked me to provide a comment on this, so I do, although I do not have much to say.
In essence, I think that Bjarne's observations and suggestions to enhance the spec in the DataValue part for Picoseconds are right in both cases. However, there is hardly any other reasonable way to implement it, so the risk of somebody doing it wrong is low.

BjarneBostrom

2021-05-24 07:07

reporter   ~0014416

Also, as extra clarification, the link "https://reference.opcfoundation.org/Core/docs/Part6/#5.2.2.5" was obtained by pressing the black-up-arrow-"button" next-to the 5.2.2.5 DateTime header in the docs, so either the link it gave is wrong, or the redirection of that link is wrong (so it could go 2 ways). Apparently this link should work as-is now: https://reference.opcfoundation.org/Core/docs/Part6/5.2.2/#5.2.2.5 so either that should be returned from the header-link-arrow-"button" or the link it gives should redirect properly to the section of the TOC it is. Preferably there would be 2 buttons, one to go back to TOC and another as "permanent link" style that could be pasted to answers etc. "see this section". Since the TOC is only 3 levels, it is a bit hard to get a link easily (like yes, it is quite easy if one knows how it works).

Randy Armstrong

2021-08-14 03:28

administrator   ~0014742

Added precision rules that include picosecond handling to OPC 10000-6 - UA Specification Part 6 - Mappings 1.05.3 RC

Randy Armstrong

2021-08-17 16:12

administrator   ~0014750

Reviewed text in WG - need to review description in version table before closing.

Jim Luth

2021-08-31 16:42

administrator   ~0014793

Agreed to changes in 1.05.01 Draft 4.

Issue History

Date Modified Username Field Change
2021-05-20 10:45 BjarneBostrom New Issue
2021-05-20 15:19 Zbynek Zahradnik Note Added: 0014414
2021-05-24 07:07 BjarneBostrom Note Added: 0014416
2021-05-25 15:28 Jim Luth Assigned To => Randy Armstrong
2021-05-25 15:28 Jim Luth Status new => assigned
2021-08-14 03:28 Randy Armstrong Status assigned => resolved
2021-08-14 03:28 Randy Armstrong Resolution open => fixed
2021-08-14 03:28 Randy Armstrong Note Added: 0014742
2021-08-17 16:12 Randy Armstrong Note Added: 0014750
2021-08-18 06:27 Randy Armstrong Relationship added related to 0006811
2021-08-31 16:42 Jim Luth Status resolved => closed
2021-08-31 16:42 Jim Luth Note Added: 0014793