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: 323
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: 78

Currently Online: japedGAL
21 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 87

pramanj: 86

ibrahim: 68

kapsl: 57

gjevremovic: 49

TimK: 41

Fransua33: 39

fred: 36

Rainer Versteeg: 32

peterrob45: 25

Member Stats:

Guest Posters: 0

Members: 795

Moderators: 11

Admins: 1

Forum Stats:

Groups: 3

Forums: 14

Topics: 829

Posts: 3519

Newest Members:

marco_pth, girishm39, hallieoaks66, Jimmy Ni, nisha.kale1122, kcdico, automsoft, wyattetal, SerkanSahin, sophiarobin

Moderators: Jouni Aro: 823, Otso Palonen: 32, Tuomas Hiltunen: 5, janimakela: 0, Pyry: 1, Terho: 0, Petri: 0, Bjarne Boström: 323, Heikki Tahvanainen: 402, Jukka Asikainen: 1, Teppo Uimonen: 10

Administrators: admin: 0