Professional OPC
Development Tools


Browsing server with items added dynamically after initialization -> new items never found.

10 Nov 2014 12:07 #2508 by Emilio
Hello Zbynek,

I think there is a misunderstanding at this point...

Your explanation is quite clear, that is why we keep the OPC server running with some other OPC connection.

When we browse the OPC server again with BrowseBranches(), the server is already running with the Dynamic items as well. An OPC client is already connected.

The BrowseBranches() returns only the Static ones.

The second part in your answer does not work, that's why I made this post.

If I try to read a dynamic item, then also BrowseBranches() work, but I can't do this in the reality, I do not know which Items are there.

Please Log in or Create an account to join the conversation.

10 Nov 2014 09:13 #2507 by support

the reason for this behavior is quite clear, and is by design.

What happens is that we disconnect from the server after a configured time (I think the default is 10 or 15 seconds) if it is not in use - i.e. shortly after the first browse. Consequently your server stops (the DANsrvNet.exe process disappears from the Task Manager). The second browse, after one minute, starts the server again, and therefore it sees the "Static" branch only.

If you keep the server running, things work just well. This can be achieved e.g.
- by designing it as a service
- by having another OPC client permanently connected to it
- by subscribing to some item
- by pro-longing the configurable disconnection delay to whatever time you need (e.g. 5 minutes instead of 10 seconds)

You need to understand that from the client point of view, the server behavior should NOT depend on whether the server has been "just started", or has been, by coincidence, running already. Clients have no way of knowing this.

Best regards

Please Log in or Create an account to join the conversation.

10 Nov 2014 06:17 #2506 by Emilio
Hello Zbynek,
I've just added the ZIP again.

On Friday I also sent an email to you, to thank for the license, but it also came back (rejected).

Everything went fine, thanks for the info.


Please Log in or Create an account to join the conversation.

08 Nov 2014 15:48 #2505 by support

I do not see the attachment - are you sure you have added it? (Note: not all file extensions are allowed; but .ZIP is). If you get into any problems, please email it to me instead.

Best regards

Please Log in or Create an account to join the conversation.

07 Nov 2014 12:09 #2495 by Emilio
Hello, I think this would be the easiest way:

I can reproduce the problem with an OPC DA Server that I created today morning. The real one is too difficult to use (it requires more infrastructure) and the problem is reproduceable with the fake one.

You can do the following:

- Unzip the content into any folder.
- Execute RegServer.exe (as Administrator if under Windows 7), without parameters.
- Connect the server (the name is: Endress.RuntimeNewItems.Test.1) from any OPC DA Client.
- If you browse immediately, then you see one branch, called Static, with 1000 items.
- Keep the connection alive, for example monitor one item.
- Try now with QuickOpc -> BrowseBranches(ServerDescriptor) -> you see the only branche.
- After at least one minute, connect another OPC Client (or the same like before, if it supports refresh) and browse again.
- You see 2 branches, Satic and Dynamic. Dynamic has also 1000 items.
- Now do it again with QuickOpc -> BrowseBranches(ServerDescriptor) -> you see only the first branche!

Please Log in or Create an account to join the conversation.

07 Nov 2014 11:52 #2494 by support
Hello. Is it possible you post which OPC server this happens with? Which OPC versions it supports? (1.0, 2.0, 3.0)?

With the other OPC client, can you influence which OPC spec it uses? (1.0, 2.0, or 3.0?) The browsing interfaces are different in these. And many servers implement more specs, and differences can arise depending on which browsing interface gets used by the client actually.

I suggest you deploy an OPC Analyzer, and collect the traces 1) with a client application written with QuickOPC, and 2) with other OPC client. I do not recall whether we have used the OPC Analyzer with you before. If not, let me know and I will provide the instructions and a download link.

Best regards

Please Log in or Create an account to join the conversation.

07 Nov 2014 08:27 - 07 Nov 2014 09:37 #2493 by Emilio
I give here a complete example of this issue.
I start an OPC DA server with an OPC DA client.
Initially the server creates 1000 items under a node called "Static".
The node is visible in the clioent and also its 1000 items.
One minute later the server creates a new node called "Dynamic" and adds there other 1000 items.
If I start now a second OPC client then I see the two nodes and all together the 2000 items.
At this point I start our application, which uses OpcLabs components.

When I browse this server, the first "browse" call (the rest goes recursively):

var opc = new EasyDAClient { Isolated = false };
var serverDescriptor = new ServerDescriptor(serverName);
var branches = opc.BrowseBranches(serverDescriptor);

NEVER returns the second branch, the one that was created dynamically one minute after first server connection.

This happens in all logical cases:
1) I start our application AFTER any connected OPC client is already showing the two branches.
2) I start our application once, wait some minute and browse again.

The second branche, at least in this example, is NEVER coming.

I made the following observation:
If I browse a dynamic node, just to test, obviously the software cannot know about nodes before the first BrowseBranches(), with the following statements:

var nodeDescriptor = new DANodeDescriptor("Dynamic");
var nodeFilter = new DANodeFilter();
var nodeCollection = opc.BrowseNodes(serverDescriptor, nodeDescriptor, nodeFilter);

and THEN I call the BrowseBranches(), then all items are coming!!!
They also come the next time (within a short time) also without browsing the specific node first.

We need a solution at this point: how a first BrowseBranches() (or some other instruction) can retrieve the current OPC Address Space, at least the immediate branches under the root.
Last edit: 07 Nov 2014 09:37 by Emilio. Reason: New observation.

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.205 seconds


 Recommend this on Google