Please consider registering

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
Jim Stanton
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
Bjarne Boström
Forum Posts: 801
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline


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
Jim Stanton
Forum Posts: 6
Member Since:
May 7, 2018
sp_UserOfflineSmall Offline

Hello Bjarne,

Thanks for the quick reply and good explanation!


Forum Timezone: Europe/Helsinki

Most Users Ever Online: 267

Currently Online: felisharedden25
10 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 120

pramanj: 86

ibrahim: 74

rocket science: 65

kapsl: 57

gjevremovic: 49

Sabari: 44

Xavier: 42

fred: 41

TimK: 41

Member Stats:

Guest Posters: 0

Members: 3124

Moderators: 17

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1277

Posts: 5457

Newest Members:

felisharedden25, valentinanoblet, XNXXguini, RobertTop, baileyuup3516, Richardlacle, inezwb11, clarissabeasley, raulakhtar528, claritanisbett4

Moderators: Jouni Aro: 942, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 801, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 25, Teppo Uimonen: 21, Markus Johansson: 41, Niklas Nurminen: 0, Matti Siponen: 209, Lusetti: 0

Administrators: admin: 1