Namespace ready to use for client?|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
Namespace ready to use for client?
Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
1
12/07/2022 - 02:30
sp_Permalink sp_Print sp_EditHistory

Hello,

how does a OPC UA client know, that a namespace listed in the Server NamespaceArray is ready to use (all mandatory type/instance nodes are present in the information model)?

I can't find anything about that in the specification.

Best regards,
Thomas

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
2
12/07/2022 - 12:51
sp_Permalink sp_Print

Servers are not required to expose Types that are not used.

So supporting a CS Namespace does not mean that all types in the CS Namespace are guaranteed to be there.

If a Type is used then the Server is expected to use it properly so if an instance exist you can assume it is 'ready to be used'.

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
3
12/12/2022 - 01:41
sp_Permalink sp_Print

So a OPC UA client has to try to browse for an instance in the address space until the nodes get created by the OPC UA Server?

In our case a possible solution would for example be, that the OPC UA Client listens to a GeneralModelChanged Event on the Namespace 0 Server-Object and waits until the CS Namespace is present in the NamespaceArray. Because then the client can be sure that the instance nodes were created by the OPC UA Server. Is this a viable way to go?

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
4
12/12/2022 - 07:49
sp_Permalink sp_Print

No. The type nodes need to exist even if a client has not actually browsed an instance.

Types can be omitted only if the server knows that instances it has will never reference it.

If the server does not know it needs to have the the type.

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
5
12/12/2022 - 09:24
sp_Permalink sp_Print

Our Server creates all the type and instance nodes for this special CS Namespace, this is not my question. 

But before our Server SDK creates types (and/or instances) nodes, the Namespace URI is added to the NamespaceArray (NS 0) and creating the nodes may take some time. The Client sees this Namespace URI in the NamespaceArray and starts to browse/read/... nodes from this namespace, which are not created yet.

And I think it's correct that our Server SDK adds the Namespace URI to the NamespaceArray before it creates nodes because otherwise the Namespace-Index would be invalid.

And then this would be necessary:

Thomas said
So a OPC UA client has to try to browse for an instance in the address space until the nodes get created by the OPC UA Server?

  

Or maybe I don't get your answer?
Can you maybe link to some specifications/docs?

Thanks!

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
6
12/12/2022 - 16:20
sp_Permalink sp_Print sp_EditHistory

I don't quite get the issue.

A server has to add a NamespaceUri to the NamespaceArray before it returns any reference to that NamespaceIndex.

An entry in the NamespaceArray does NOT imply compliance with CS. It just means something in the address space might reference that URI. It is wrong for a client to assume that an entry in the NamespaceArray automatically implies that certain types/instances must be present.

If fact it is legal for a server that has been reconfigured to keep a reference to URI in its NamespaceArray  to avoid changing indexes for other URIs even if there are no references in the address space to that URI.

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
7
12/13/2022 - 00:49
sp_Permalink sp_Print

Randy Armstrong said

An entry in the NamespaceArray does NOT imply compliance with CS. It just means something in the address space might reference that URI. It is wrong for a client to assume that an entry in the NamespaceArray automatically implies that certain types/instances must be present.

Thanks for clarification, this is exactly what I assumed for the server-side. Smile

So how would you implement the client-side?
As mentioned above I had 2 approaches:

  1. try to browse until the nodes are present (poll)
  2. or in our special CS Namespace a possible solution would be to: (event)

    Thomas said

    In our case a possible solution would for example be, that the OPC UA Client listens to a GeneralModelChanged Event on the Namespace 0 Server-Object and waits until the CS Namespace is present in the NamespaceArray. Because then the client can be sure that the instance nodes were created by the OPC UA Server. Is this a viable way to go?

    (because we have a GeneralModelChanged in our CS Namespace)

  3.  ... other solutions?

Do you have better approaches for the client-side implementation?

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
8
12/13/2022 - 08:36
sp_Permalink sp_Print

The GeneralModelChanged is not produced when the Value of a Variable changes. Clients are expected to subscribe.

Clients should not be using the NamespaceArray as a signal. Clients only use it when they have some other reason to request Nodes from the Server. In your case, you need to produce an event that indicates that the loading is done. GeneralModelChanged is specific to a Node so it will not do what you want.

I suggest the ProgressEventType:

https://reference.opcfoundatio.....35#Table56

The client waits until Progress=100.

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
9
12/13/2022 - 08:57
sp_Permalink sp_Print

Thanks, nice suggestion.

To sum it up you would send this Progress Event to all active clients with following data, when the server finished loading?:

SourceNode = null-NodeId // because no Client initiated the Server to build the namespace - this is default behavior of a server
SourceName = "MyCSCustomName"
Context = null-NodeId // not needed
Progress = 100 // finished

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
10
12/13/2022 - 09:47
sp_Permalink sp_Print

All namespaces should have a NamespaceMetadata Object.

https://reference.opcfoundatio.....ocs/6.3.13

Add Server => HasEventSource => NamespaceMetadata

Add NamespaceMetadata => GeneratesEvent => ProgressEventType

ProgressEventType: SourceNode/SourceName = NamespaceMetadata 

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
11
12/14/2022 - 01:07
sp_Permalink sp_Print

Thank you for clarification.

I'm going to bring this up in the Euromap/VDMA organisation as well, maybe other clients out there already faced a similar issue?

I think this topic is a quite important base functionality which is currently missing in the OPC UA specification. Do you think this too? In the future maybe the specification can be extended or an amendment for this could be created? Can you please discuss this internally in the foundation?

One last additional question: How would this work for Server/Client implementations which are not supporting Events?
Maybe the NamespaceMetadata-Type can be extended with a (optional) Ready/Progress-Property? But this would then be again a chicken-and-egg problem because how does the client know that the NamespaceMedatadata information model has finished loading/creating nodes and is ready to use.

Maybe an overall status (like the ServerStatus; maybe this could also be extended) for the Server would be also interesting for clients.

Avatar
Randy Armstrong
Admin
Forum Posts: 1445
Member Since:
05/30/2017
sp_UserOfflineSmall Offline
12
12/14/2022 - 07:43
sp_Permalink sp_Print

You should add a mantis issue against Part 3:

https://mantis.opcfoundation.o.....default=no

There are a number of edge cases that need to be considered. Not supporting events is just one.

Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
Avatar
Thomas Steiner
Member
Members
Forum Posts: 8
Member Since:
03/19/2019
sp_UserOfflineSmall Offline
14
04/18/2023 - 22:46
sp_Permalink sp_Print

Thomas Steiner said
Done! Smile

https://mantis.opcfoundation.o.....hp?id=8570

  

UPDATE: This won't be fixed by the Standard!

Reason: Nodes in the UA Address Space are dynamic - a Client can never be sure if a Namespace is fully loaded (all Nodes are present)
The standard committee suggested to use the Server State (e.g, NO_CONFIGURATION_2 or SUSPENDED_3) to indicate that.

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