Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supporting complex/structured types in simple protocols #1936

Open
egekorkan opened this issue Dec 13, 2023 · 4 comments
Open

Supporting complex/structured types in simple protocols #1936

egekorkan opened this issue Dec 13, 2023 · 4 comments
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained

Comments

@egekorkan
Copy link
Contributor

Relates to #1930.

Some devices do not support complex/structured types but device manufacturers do some "adjustments" to accommodate that. Something we see in Modbus devices is that object-like data is split into multiple registers where one set contains one "key" of the object and the other contains another "key". There is an example at the end where 3 registers contain the voltage value and another 3 contain a timestamp in Unix time.

This is part of the data mapping discussion, but we need an object data schema that maps one key to one set of registers and the other key to the others.

modbus-complex

Also available publicly at https://cache.industry.siemens.com/dl/files/595/34261595/att_951630/v1/manual_pac4200_en-US_en-US.pdf on page 161 (Table A- 17)

@egekorkan egekorkan added the Has Use Case Potential The use case can be extracted and explained label Dec 13, 2023
@github-actions github-actions bot added the needs-triage Automatically added to new issues. TF should triage them with proper labels label Dec 13, 2023
@egekorkan egekorkan removed the needs-triage Automatically added to new issues. TF should triage them with proper labels label Dec 13, 2023
@lu-zero
Copy link
Contributor

lu-zero commented Dec 13, 2023

This is a good example of a data map in the read direction, if we consider adding an expression-filter on top of mapping we could provide conversions from bytes to float and integer.

@Kaz040
Copy link

Kaz040 commented Jan 8, 2024

This issue is being discussed in relations to PROFINET also. a resource in a profinet device can be an object. the definition of the object payload is always provided in the device manual. an example is this SITOP device, https://cache.industry.siemens.com/dl/files/415/84977415/att_906547/v1/A5E37775406-7-76_MANUAL_SITOP-UPS1600-UPS1100_en-US.pdf on page 130.

The first parameter --> Buffering parameters

image

is a complex payload. inside it are parameters defined in the table below

image.

so to be able to capture what each byte or byte stream from the payload mean, terms like profinet : offset, profinet : byte or profinet : length (decision not made yet on term name) and profinet : bit, can be profinet : bitmask are to be introduced. To do this, the definition has to be at dataSchema level.

My question now is, should these terms be protocol specific or generic for payloads in byte streams?

@relu91
Copy link
Member

relu91 commented Jan 8, 2024

My question now is, should these terms be protocol specific or generic for payloads in byte streams?

My gut feeling is that we can find some generic way to support this across different protocols and collecting usecase/examples in from different stacks should help us achieve that. On the other hand, generalizing has its own drawbacks which we should be aware of and instruct the TD user about.

Btw I want to mention that in node-wot we are starting to explore this feature. Right now it is very rough, we accepted one PR where we introduced a way to encode objects in octet-stream content-types and we are about to accept a second one. We are taking a bottom-up approach to see something moving. I'm not saying that this is the right solution, but it is just to link the issues and let the community be aware of our steps.

@lu-zero
Copy link
Contributor

lu-zero commented Jan 8, 2024

My question now is, should these terms be protocol specific or generic for payloads in byte streams?

We have the protocol driving the in-wire serialization, the contentType that should describe the format from the bytes (with contentCoding if we have some compression in the middle) and then we have the dataschema that describes the structure once-de/serialized according to the format (e.g. from json/yaml/xml/etc).

I'm wary of adding our custom contentTypes and I'd rather reuse the datamapper concept even for this purpose since it is a special case of extracting from the logic schema and mapping items to the various side/main channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defer to TD 2.0 Has Use Case Potential The use case can be extracted and explained
Projects
None yet
Development

No branches or pull requests

4 participants