Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Server always sends status code Bad_WaitingForInitialData with value null on subscription
February 4, 2019
16:39, EET
Avatar
Jim Stanton
Member
Members
Forum Posts: 6
Member Since:
May 7, 2018
sp_UserOfflineSmall Offline

I have a question to the behaviour of the Prosys OPC UA Modbus Server. When subscribing a node, the server always first sends status code Bad_WaitingForInitialData with value null, immediately followed by the actual value of the Modbus device with status code GOOD. In our application the first response after subscribing is expected to be the initial data of the device (not the second response).

Is it correct that the Prosys OPC UA Modbus Server behaves like that?

For our application, this is an essential difference! When the application connects to the server and subscribes all nodes, the first response will be handled as the initial data from the server even if the status code is Uncertain or Bad. This is registered as the server’s current state for all nodes. When the second response of values are reported by the Prosys OPC UA Modbus Server, they are handled as value changes and the application starts to evaluate and react to those changes.

We are connecting and subscribing many different OPC UA servers from our application and each of them first send the actual current (device) state of a node upon subscription. New we have one system integrator testing the Prosys OPC UA Modbus Server and we encounter this problem.

February 4, 2019
18:11, EET
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 983
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Thanks for the question. It is intentional and according to the OPC UA Specification.

Spec 1.04 Part 4 section 7.34.2 Table 178 last entry:
“Bad_WaitingForInitialData Waiting for the Server to obtain values from the underlying data source.
After creating a MonitoredItem or after setting the MonitoringMode from DISABLED to
REPORTING or SAMPLING, it may take some time for the Server to actually obtain
values for these items. In such cases the Server can send a Notification with this status
prior to the Notification with the first value or status from the data source.”

i.e. an OPC UA Client can _never_ assume the first notification to be a “real” notification.

Additionally Table 160 in section 7.20.2 for the DataChangeNotification Value field:
“Value DataValue The StatusCode, value and timestamp(s) of the monitored Attribute depending
on the sampling and queuing configuration.
If the StatusCode indicates an error then the value is to be ignored.
If not every detected change has been returned since the Server’s queue
buffer for the MonitoredItem reached its limit and had to purge out data and
the size of the queue is larger than one, the Overflow bit in the DataValue
InfoBits of the statusCode is set.”

Therefore you should always check the status as well (in ALL notifications).

This is somewhat a trade-off between making the items fast and sending that as first notification vs. waiting for the data. The current design in the latests versions avoids some problems if a client makes 100s of monitoreditems at once. We could revisit that at some point (or maybe add some options), however the current impl is something any UA Client should be able to handle.

February 4, 2019
18:24, EET
Avatar
Jim Stanton
Member
Members
Forum Posts: 6
Member Since:
May 7, 2018
sp_UserOfflineSmall Offline

Hello Bjarne,

Thanks for the quick reply and good explanation!

Cheers
Jim

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 518

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1