View Issue Details

IDProjectCategoryView StatusLast Update
000576210000-003: Address SpaceSpecpublic2021-05-04 15:13
ReporterDavid Levine Assigned ToJeff Harding  
PrioritynormalSeveritymajorReproducibilityhave not tried
Status closedResolutionfixed 
Summary0005762: Create new service Read-Modify-Write (RMW) for integral values, arrays and fields in structs.
Description

it is common to want to write to a part of a data item. Examples:
1) One of more bits in an integral value: bits 0, 3, 5 in an 32 bit integer
2) one or more elements in an array: elements 3, 100, 101 in a 1000 element array
3) one or more fields in a structure

This feature has been demanded by our customers, and explicit support was added with explicit services in our PLCs and in our communications stack. When this is not available the only other way to write a single value within a larger data item (e.g. bits within a word) is to first read the item, modify it, and write it back. This creates risk due to the time lag between when the value was read and when the modified value is written back - the part that was not supposed to be modified may be "stale" and no longer the correct value. The need for a builtin service increases as the size in bytes of the item(s) increases because it takes longer to read it and write it back, raising the risk of writing "stale" data to the server, plus the comms + app layers are not real-time so cannot guarantee a response within a deadline.

Support for this to be optional so that servers that cannot guarantee RMW semantics are not forced to support it.

This mode is already optionally supported for arrays: indexed writes. The desired goal is to extend this to other data items where it makes sense.

Strawman proposal:

Whether or not RMW is supported for a fundamental type to be defined; e.g.
Abstract types not supported, only concrete types
Supported for all sizes of signed and unsigned integers, but not for floats or doubles.
Supported for words in a String or characters in a word
Not directly supported for some fundamental types: DateTime, LocalizedText, QualifiedName, BuildInfo, etc.

Arrays and structures
Arrays already support this per-element. This can be extended to the element itself if it is a supported data type. e.g. array of uint32 could support RMW for the bits in an element.
Structures can support RMW for fields within a struct; e.g modify the value of Field2 without changing the other fields.
Fields within a struct can also support RMW if the field's data type is a fundamental which supports RMW, similar to an array.

Each supported type should be optional with its own conformance unit. e.g. all signed/unsigned integers is one unit, strings another, etc.

Support for optional types to be reported in a server capability object.

Possible priority:
1) bits in signed/unsigned integers
2) Fields in a struct (replace entire field value)
3) bits in elements in an array
4) bits in Field when it is a signed/unsigned integer
5) bits in elements in Field when it is an array of signed/unsigned integer
6) words in string
7) characters in string
etc.

TagsNo tags attached.
Commit Version
Fix Due Date

Relationships

parent of 0005837 closedJeff Harding 10000-005: Information Model Create new service Read-Modify-Write (RMW) for integral values, arrays and fields in structs. 
related to 0005686 closedJim Luth Feature Requests Ability to request a subset of fields from a structured data type. 

Activities

Jim Luth

2020-07-07 16:38

administrator   ~0012560

We think we can do most of this with the existing services and info model. Consider adding a new reference type to clearly identify the sub-variables that represent the subsets of the writable fields in the parent structure.

Jeff Harding

2020-07-28 13:20

developer   ~0012629

Added new reference type HasStructureComponent as a specialization of HasComponent which can be used to reference a Variable which is representing a member of a Structure DataType.

David Levine

2020-07-28 13:33

developer   ~0012630

Can you provide a link to the reference description?

Jeff Harding

2020-07-28 14:51

developer   ~0012633

Added new ReferenceType HasStructureComponent

Jeff Harding

2020-08-25 15:02

developer   ~0012720

Further discussion resulted in the need to also add text to explain that the browse name (ns and name) shall match the field name the variable represents. The NS shall match the NS of the Structure's DataType.

Jeff Harding

2020-12-08 15:55

developer   ~0013401

Last edited: 2020-12-10 14:28

A example of this type of subvariable approach is the ServerStatus type defined in Part 5.
The Variable BrowseNames start with an uppercase character while the field names start with a lowercase character. We will need an additional statement to make the comparison case insensitive at least for the first character. This isn't an issue because while the specifications use a lower case first character the implementation does not.

Jeff Harding

2020-12-10 14:28

developer   ~0013442

Added descriptions of how to handle arrays of structures including a simple example.

Jim Luth

2020-12-10 19:53

administrator   ~0013460

Agreed to changes edited in Virtual F2F.

Jim Luth

2021-04-20 16:16

administrator   ~0014231

  1. Clarify namespace index is from the NodeID of the structured DataType definiion.

  2. Clarify that the namespace index used coresponds that of the DataType definition where the Field is first defined. (Give example where new fields are added in a derived structure.)

Jeff Harding

2021-05-03 18:15

developer   ~0014293

If we proceed as suggested then the NameSpaceIndex would actually be the NameSpaceIndex of the name field of the StructureField DataType which defines the field in the fields field of the StructureDefinition Datatype which defines the Structured DataType used by the Variable which is the target of the reference.
Very complex chain to describe but I think this is what we have agreed to.
If we defined this way I don't see a need for the derived structure since it is the field definition not the structure itself.

Jeff Harding

2021-05-03 18:25

developer   ~0014294

Added additional explanation regarding the NamespaceIndex of the fields.

Jim Luth

2021-05-04 15:13

administrator   ~0014301

Agreed to changes edited in telecon.

Issue History

Date Modified Username Field Change
2020-06-25 16:31 David Levine New Issue
2020-07-07 16:38 Jim Luth Note Added: 0012560
2020-07-07 16:39 Jim Luth Assigned To => Jeff Harding
2020-07-07 16:39 Jim Luth Status new => assigned
2020-07-07 16:39 Jim Luth Project 10000-004: Services => 10000-003: Address Space
2020-07-28 13:20 Jeff Harding Note Added: 0012629
2020-07-28 13:33 David Levine Note Added: 0012630
2020-07-28 14:40 Jeff Harding Issue cloned: 0005837
2020-07-28 14:40 Jeff Harding Relationship added parent of 0005837
2020-07-28 14:51 Jeff Harding Status assigned => resolved
2020-07-28 14:51 Jeff Harding Resolution open => fixed
2020-07-28 14:51 Jeff Harding Fixed in Version => 1.05
2020-07-28 14:51 Jeff Harding Note Added: 0012633
2020-08-25 15:02 Jeff Harding Status resolved => feedback
2020-08-25 15:02 Jeff Harding Resolution fixed => reopened
2020-08-25 15:02 Jeff Harding Note Added: 0012720
2020-08-25 15:02 Jeff Harding Status feedback => assigned
2020-08-25 16:36 Jim Luth Relationship added related to 0005686
2020-12-08 15:55 Jeff Harding Note Added: 0013401
2020-12-10 14:28 Jeff Harding Note Edited: 0013401
2020-12-10 14:28 Jeff Harding Status assigned => resolved
2020-12-10 14:28 Jeff Harding Resolution reopened => fixed
2020-12-10 14:28 Jeff Harding Note Added: 0013442
2020-12-10 19:53 Jim Luth Status resolved => closed
2020-12-10 19:53 Jim Luth Note Added: 0013460
2021-04-20 16:16 Jim Luth Status closed => feedback
2021-04-20 16:16 Jim Luth Resolution fixed => reopened
2021-04-20 16:16 Jim Luth Note Added: 0014231
2021-04-22 15:21 Jim Luth Status feedback => assigned
2021-05-03 18:15 Jeff Harding Note Added: 0014293
2021-05-03 18:25 Jeff Harding Status assigned => resolved
2021-05-03 18:25 Jeff Harding Resolution reopened => fixed
2021-05-03 18:25 Jeff Harding Note Added: 0014294
2021-05-04 15:13 Jim Luth Status resolved => closed
2021-05-04 15:13 Jim Luth Note Added: 0014301