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
OPC UA client cannot reconnect to OPC UA server after state change
October 24, 2022
16:43, EEST
Avatar
SebastianS
Member
Members
Forum Posts: 3
Member Since:
June 1, 2022
sp_UserOfflineSmall Offline

Usually the OPC UA client (sdk 4.5.8-1468) gets in the state “Running” and connects properly to the server.
Ther’s absolutely no problem to subscribe to a certain node or anything else.
In the error case suddenly there’s a state change on server side and as soon as the server is up again the client is trying to subscribe to the needed nodes.
While the client is trying to subscribe to its needed nodes it crashes making the following log entry:

“Bad_NodeIdUnknown (0x80340000) “The node id refers to a node that does not exist in the server address space.” “

What could be the reason for that?

Thanks a lot in advance!

Regards,
Sebastian

October 24, 2022
17:57, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1026
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Some servers sometimes do not have their nodes available immediately after reconnecting. I would say that is probably a bug and it should be reported to the server vendor. Though, depending on the server it might also be somewhat valid behavior depending on the data source (e.g. if it aggregates data from multiple sources, it might not have yet had a connection to all of them, and this might not be deterministic, so it might just have to accept incoming connections after some period).

That version of the SDK is quite old, I would recommend updating it. https://downloads.prosysopc.com/opcua/Prosys_OPC_UA_SDK_for_Java_4_Release_Notes.html, 4.6.0 added: “Improved: Subscription.setRecreateFailedItems(boolean) can be called to enable a Subscription to automatically attempt to recreate MonitoredItems with error code Bad_NodeIdUnknown since this StatusCode can imply in some cases that the Server hasn’t added that Node to its AddressSpace yet.” and in 4.8.0 that is by default true, due to these cases. And 4.9.0 is the latest version, thus I would recommend updating to that.

I should note that it could also be something else, but the above was the most typical case. For example, if you have made your MonitoredItems via NodeId, the index could have been changed on the server (per spec it can change every Session, only the 0 and 1 indexes are fixed, but like typically servers keep it static). This could be solved by making the item via ExpandedNodeId instead (by using the NamespaceUri version).

And also in theory the node could have been removed, there is no way for the SDK to know that, but I assume this is not the case here as you can validate that it probably exists.

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
29 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 738

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1524

Posts: 6451

Newest Members:

jonathonmcintyre, fannielima, kristiewinkle8, rust, christamcdowall, redaahern07571, nigelbdhmp, travistimmons, AnnelCib, dalenegettinger

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1026, Jimmy Ni: 26, Matti Siponen: 346, Lusetti: 0

Administrators: admin: 1