equinor / iec63131

Other
9 stars 8 forks source link

Alignment of data types for duration related attributes #60

Closed AlexTxen closed 1 year ago

AlexTxen commented 2 years ago

Currently there is misalignment between used data types for duration related attributes. E.g. TimerR->TimeDelay attribute has 'decimal' data type, but TimeDelay attributes on alarms (e.g. MA->AHH->TimeDelay) have 'duration' data type. Data types for all delays/timers should be aligned.

Proposal is to use 'duration' data type. IEC62424 refers to built-in XML data types (http://www.w3.org/TR/xmlschema-2/#built-in-datatypes), and built-in 'duration' type is from ISO 8601. 'duration' type notation is 'PnYnMnDTnHnMnS', where each 'n' is number of years/months/days/hours/minutes/seconds. In this case 'Unit' for attribute is not to be used. This approach would give unambiguous notation of time delays.

PatrickRasche commented 2 years ago

I see a challange in that when not a plain duration is provided, but more like a maximum duration. In example files a found situations where "< 30min" is stated, we could define 30 min with that expression, but how to indicate the "less then"?

Erik0x42 commented 2 years ago

@PatrickRasche, could you provide more information? Which attribute, in which class?

PatrickRasche commented 2 years ago

@Erik0x42, it's an example from the current Krafla shutdown hierarchies provided by Aibel. For the timer (ElementaryFunctionLibrary/NorsokElementaryFunctionClass/SignalOperation/TimerR) in the screenshot below the time delay attribute contains such an information.

image

Of course the engineering background of this information is clear, but it's more like an maximum time delay instead of an fixed one. Maybe @cdenisey can give more details to it.

cdenisey commented 2 years ago

Of course the engineering background of this information is clear, but it's more like an maximum time delay instead of an fixed one. Maybe @cdenisey can give more details to it.

After discussion with the project, duration should be strictly a value and comparator such as greater than or lesser than shall not be used within the TimeDelay Value. Project document has been updated accordingly.

Proposal to use 'duration' data type will be implemented as part of the next Milestone.

AlexTxen commented 1 year ago

Implemented in 6ad58bfaea13403ad3d597b8b7c17969ae725536 Issue can be closed.

Changed DataType to 'xs:duration' (built-in XML data type, ref. http://www.w3.org/TR/xmlschema-2/#built-in-datatypes) for 'TimerR/F'->'TimeDelay' and 'PulseR/F'->'PulseLength'