OPC UA PubSub multiple same DataSetWriterId in one NetworkMessage|OPC UA Standard|Forum|OPC Foundation

Avatar
Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
Lost password?
sp_Feed sp_PrintTopic sp_TopicIcon
OPC UA PubSub multiple same DataSetWriterId in one NetworkMessage
Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
1
12/09/2020 - 02:20
sp_Permalink sp_Print sp_EditHistory

Is it permitted to use the same DataSetWriterId in one NetworkMessage?

For instance:

"messages": [
    {
      "DataSetWriterId": 77,
      "Timestamp": "1",
      "Payload": {
          "temp": 55,
      }
    },
    {
      "DataSetWriterId": 77,
      "Timestamp": "2",
      "Payload": {
          "temp": 57,
      }
    }
]

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
12/09/2020 - 12:04
sp_Permalink sp_Print

I can't see any restriction in the specification and I can't see why it could cause a problem for the JSON encoding.

It does not make sense for the UDP encoding.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
3
12/10/2020 - 00:41
sp_Permalink sp_Print

"I can't see any restriction in the specification and I can't see why it could cause a problem for the JSON encoding."

Ok this is fine for me.

"It does not make sense for the UDP encoding."

Did you mean the UA Binary encoding? And why make it for "UDP" encoding no sense?

Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
12/10/2020 - 01:54
sp_Permalink sp_Print

The UA Binary encoding includes fixed size layouts where the position DataSetMessages is set in configuration. It would not make sense to allocate two positions to the same DataSetWriter.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
5
12/10/2020 - 03:30
sp_Permalink sp_Print

Ok, that make sense. Thanks for clarification!

But now, imho it make no sense to create/use some JSON messages layout which is not convertable into the UA Binary protocol.
Is this maybe a missing definition rule/restriction for the JSON message in Part 14?

How is it possible in PubSub to create message(s) like a queue from a MonitoredItems in a PublishResponse message?

Avatar
Matthias Damm
Moderator
Members

Moderators-Companion
Forum Posts: 10
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
6
12/10/2020 - 06:52
sp_Permalink sp_Print

The capability of adding more than one DataSetMessage from one DataSetWriter into a NetworkMessage is independent of the encoding. This is possible in JSON and UADP Message Mapping.

 

If it is allowed (makes sense) depende on the configuration of the DataSetWriter KeyFrameCount and the type of data source.

 

A KeyFrameCount of >=1 is used for cyclic communication. In this case, a DataSetWriterId is only one time in a NetworkMessage, independent of JSON or UADP. This is normally the case for cyclic sending of a variable values.

 

A KeyFrameCount of 0 indicates an event based data source and if there are several events in one PublishingInterval, the same DataSetWriterId can be several times (>=0) in a NetworkMessage. This would be used if the source is an OPC UA Event subscription.

Avatar
Martin Lang
Germany
Member
Members
Forum Posts: 72
Member Since:
06/25/2014
sp_UserOfflineSmall Offline
7
12/11/2020 - 09:03
sp_Permalink sp_Print

Thank you for the detailed answer!

"If it is allowed (makes sense) depende on the configuration of the DataSetWriter KeyFrameCount and the type of data source."

My understanding is "it is only valid/permitted for events".
There is no specified way to publish the equal DataSetWriterId with same Variable value (type PublishedVariableDataType/PublishedDataItemsDataType)  in one NetworkMessage. So there is no queue mechnismen like in MonitoredItem possible and the publication can only contain the latest value.
So for instance samplingIntervalHint is 100ms and PublishingInterval is 1000ms so 9 of 10 samplinged values are lost. Correct?

Avatar
Pierre-Antoine BRAMERET
Member
Members
Forum Posts: 3
Member Since:
08/13/2019
sp_UserOfflineSmall Offline
8
01/08/2021 - 04:50
sp_Permalink sp_Print

Hi,

 

We are also interested in answers about this subject. From Part 14 § 6.2.5.2 (PublishingInterval), my understanding is also that a NetworkMessage can contain multiple DataSetMessages produced by a single PublishedDataSet (hence the same DataSetWriterId may appear in this NetworkMessage), but only in the case of Events. Is that correct ?

 

In the case of Events too, there is an implicit queue mechanism that stores pending DataSetMessages before the next PublishingInterval (in case of overflow, it adds an Event of type EventQueueOverflowEventType instead of the Event). Are there more information on this queue?

 

On the wire, Event and Data DataSetMessages seems to be encoded the same way (a list of fields prefixed by the number of fields, according to §7.2.2.3.5 and §7.2.2.3.7). Hence, why would there be a difference in the handling of Events and Data ?

 

The main question finally sums up as : can we have non-cyclic PublishedDataSets (KeyFrameCount = 0) for PublishedData ?

 

Thanks in advance for your answer,

Best regards

Avatar
Vincent Lacroix
Member
Members
Forum Posts: 14
Member Since:
07/06/2017
sp_UserOfflineSmall Offline
9
01/26/2021 - 15:13
sp_Permalink sp_Print

Hi,

Reading Part 14, I don't find a definitive answer to the fact that using non-cyclic PublishedDataSets (KeyFrameCount = 0) for Published Data is allowed or forbidden.

Is it possible to obtain clarification on this particular point ?

Thanks in advance,

Best regards,

Avatar
Matthias Damm
Moderator
Members

Moderators-Companion
Forum Posts: 10
Member Since:
02/24/2014
sp_UserOfflineSmall Offline
10
01/27/2021 - 14:35
sp_Permalink sp_Print

The possible number of DataSetMessages for one DataSetWriter in a NetworkMessage depends on the KeyFrameCount.
KeyFrameCount = 0 -> number is 0 to N
KeyFrameCount = 1 -> number is always 1
KeyFrameCount > 1 -> number is 0 or 1

The DataSetWriter sends DataSets. A DataSet is described by a DataSetMetaData and this is defined by a PublishedDataSet. A PublisedDataSet also defines the source of information (if visible in OPC UA).

There are two well defined sources (1) a list of OPC UA variables and (2) OPC UA events.
Other sources are application specific and also the configuration of the source is application specific.

For the two OPC UA defined sources, the allowed KeyFrameCount values are clearly defined:
(1) PublishedDataItems requires KeyFrameCount >=1
(2) PublishedEvents requires KeyFrameCount of 0

Therefore a PublishedDataItems PublishedData set can produce maximum one DataSetMessage per PublishingInterval. In UADP it produces either a Data Key Frame DataSetMessage or a Delta Frame DataSetMessage.

A PublishedEvents PublishedData set can produce one to N DataSetMessage per PublishingInterval. In UADP it produces Event DataSetMessages.

For custom sources, it is not defined what kind of KeyFrameCount they allow and also not what kind of UADP DataSetMessage they produce.

See following spec issue as clarification request:
https://apps.opcfoundation.org.....hp?id=6409

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
11
01/29/2021 - 21:26
sp_Permalink sp_Print

Just wondering if anyone encountered such error when writing to an external mqtt broker using DataSetWriter::

———————-

[2021-01-30 00:36:56.331 (UTC+0800)] error/server       PubSub MQTT: publish: Send buffer is full. Possible reasons: send buffer is to small, sending to fast, broker not responding.
[2021-01-30 00:36:56.331 (UTC+0800)] error/server       PubSub MQTT: Publish failed
[2021-01-30 00:36:56.331 (UTC+0800)] error/server       PubSub Publish: Could not send a NetworkMessage
[2021-01-30 00:37:08.296 (UTC+0800)] warn/server        PubSub MQTT: sending failed. Invalid state.
[2021-01-30 00:37:08.296 (UTC+0800)] error/server       PubSub Publish: Could not send a NetworkMessage
 

The above error happens as I progressively add more fields to publish to the MQTT server:

 
UA_Server_addDataSetField(uaServer, publishedDataSetIdentifier, &dsCfgBootStatus, NULL); //&f_BootStatus_Id);
 
————
this happens after I try to add the 33rd DataSetField to the publishedDataSet.
 
I even specify the mqtt parameter: message_size_limit 1024000 but to no effect.
 
so long I stick within 32 fields in 1 opcua pubsub mqtt message, no problem.  If I add 1 more, the error occurs.
Avatar
Randy Armstrong
Admin
Forum Posts: 1564
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
12
01/30/2021 - 16:23
sp_Permalink sp_Print

The broker will have limits that need to configured on the broker side.

Have you looked at those?

Avatar
Jacky Bek
Member
Members
Forum Posts: 21
Member Since:
12/13/2020
sp_UserOfflineSmall Offline
13
01/31/2021 - 13:04
sp_Permalink
Awaiting Moderation

Forum Timezone: America/Phoenix
Most Users Ever Online: 510
Currently Online:
Guest(s) 24
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Forum Stats:
Groups: 2
Forums: 10
Topics: 1435
Posts: 4855