Professional OPC
Development Tools

logos

Online Forums

Technical support is provided through Support Forums below. Anybody can view them; you need to Register/Login to our site (see links in upper right corner) in order to Post questions. You do not have to be a licensed user of our product.

Please read Rules for forum posts before reporting your issue or asking a question. OPC Labs team is actively monitoring the forums, and replies as soon as possible. Various technical information can also be found in our Knowledge Base. For your convenience, we have also assembled a Frequently Asked Questions page.

Do not use the Contact page for technical issues.

Node ID format?

More
27 Jan 2023 17:48 #11491 by support
Replied by support on topic Node ID format?
OK, although it is recorded in the forum thread log that you confirmed that the other application is OPC Classic client, I will now work under the premise that it is actually an OPC UA client.

We already had a long discussion about OPC UA NodeIds some time ago on this forum. I do not want to repeat the long parts of it. What I will do is that I simply offer you what to do.

Option 1. Simply remove the "nsu=" part the way I described. The problem with this approach is that it does not pass the namespace URIs from one application to the other, it only passes namespaces indexes. And the namespaces indexes can, at least with some servers, change as the server is reconfigured, or even between sessions. Most people are not aware of this problem and also things work most of the time, but you should be aware of it.

Option 2. The proper way of doing things would be to pass the namespace URI (the "nsu=") part to your other application, and actually ignore the namespace index. And find a way, inside that other application, to specify nodes using the namespace URI and not the namespace index. I do not how the other application is constructed or whether this is doable at all. It's not my task, but that would be the fully correct way of doing it.

Regards

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

More
27 Jan 2023 17:36 #11490 by micham
Replied by micham on topic Node ID format?
Hi,

I don't recall saying that it is a classic OPC...The other application is also OPC UA client. I understand that the IGS OPC Server returns an error that looks like an OPC DA error. There is no screenshot, just a log file (see attached)

In the log file you can see this error:
2023-01-27 10:18:19.061 [OPC] ERROR, AddItem 'nsu=Industrial%20Gateway%20OPC%20Server ;ns=2;s=46E_ENI_SLC500.46E.AA46E_AD20_DEWPT' fail, itemResult = C0040008

Thank you.
Michael
Attachments:

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

More
27 Jan 2023 16:12 #11488 by support
Replied by support on topic Node ID format?
No. I have not misunderstood. I have asked you "...And you pass them to other application, which is using OPC Classic. ", to which you replied "Yes, Correct".
So we are back where we were before. I do not understand what you are doing, because you are changing your answers in fundamental ways.

Which of the statements is correct then?

And, if the external process is using OPC UA, how comes that it returns an error that is very much like OPC Classic error code (C0040008 )? And, you have not provided that full error message/screenshot to me yet, although I have asked for it.

Regards

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

More
27 Jan 2023 15:41 #11487 by micham
Replied by micham on topic Node ID format?
Hi,
1. I think you misunderstand... The external process is using OPC UA to connect to the OPC UA server.

2. The problem is that some OPC UA servers returns a good Node ID for example, Kepware OPC server returns this:
ns=2;s=Simulation Examples.Functions.Ramp1

While the IGS OPC UA server returns this:
nsu=Industrial Gateway OPC Server ;ns=2;s=46E_ENI_SLC500.46E.AA46E_AD20_DEWPT

So how can I know when do I need to make a copy of the constructor as you suggested below?

Thank you.

Michael

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

More
27 Jan 2023 15:29 #11485 by support
Replied by support on topic Node ID format?
I do not see why you are doing it this way. If you want to use the item Ids via OPC Classic (the external process) , then why you don't you also obtain them via OPC Classic browsing in your app? That way they will always be correct.

There is no standard, required mapping between OPC Classic item Ids and OPC UA Node Ids. Things that work with some or many servers are not guaranteed to work with others. If you want to write a software that is for generic use, this is not the way to go.

If you are fine with limiting yourself to server/server that do the mapping in a specific way, then of course you might do it.

Which bring me finally to the answer to the question you asked. In order to get the node Id without the "nsu=" part, do this:

1. From an existing UANodeId (e.g. the .NodeId property in UANodeDescriptor), make a copy, using a copy constructor. In C# that would something like "UANodeId nodeIdWithoutnamespaceUri = new NodeId(myExistingNodeId)";
2.Set the .NamespaceUriString property of this copy to an empty string. In C#, that would be something like "nodeIdWithoutnamespaceUri.NamespaceUriString = "";".
3. You can now take nodeIdWithoutnamespaceUri.ExpandedText and the string you are looking for will be there.

Regards

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

More
27 Jan 2023 14:17 #11481 by micham
Replied by micham on topic Node ID format?
Yes. Correct. It is working fine with many OPC servers.

The other application is reading the file with the item names and conning to the OPC server.

Thank you.

Michael

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

More
27 Jan 2023 13:41 #11479 by support
Replied by support on topic Node ID format?
Hello, we are getting there.

Is this correct understanding:

- You have obtained some node Ids over OPC UA, using your app with QuickOPC/
- And you pass them to other application, which is using OPC Classic. And they do not work, giving error C0040008 .

And you expect them to work?

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

More
27 Jan 2023 11:44 #11478 by micham
Replied by micham on topic Node ID format?
Hi,

Yes, the OPC server supports OPC UA and DA (Like Kepware Server Ex).
The error C0040008 is returned by our external process (not using the QuickOPC) that reads a file with all OPC items and is doing subscription. See the attached file.
If we fix the file and remove all "nsu=Industrial Gateway OPC Server ;" from the Node-ID, then there is no error.

No wrapper is used.

Do you understand the problem now?

Thank you.

Michael
Attachments:

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

More
27 Jan 2023 11:02 #11477 by support
Replied by support on topic Node ID format?
I still do not understand. Where you have posted is not important.
Error C0040008 related to OPC DA only. Post here the full error message, screen snapshot, or whatever helps me understand. You cannot mix Classic and UA node/item ids.

Does your server support both OPC UA and OPC Classic? Or are you using some kind of wrapper/convertor?

Without understanding what you are trying to achieve, I cannot answer the question, because it makes no sense to me.

Regards

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

More
27 Jan 2023 10:50 #11476 by micham
Replied by micham on topic Node ID format?
Hi,

Thank you for your answer. I have posted this topic by mistake in OPC DA. It is OPC UA.
This is the error we got (C0040008) when the node ID was incorrect and we tried to connect and read the value.

Incorrect node id after browsing: "nsu=Industrial Gateway OPC Server ;ns=2;s=46E_ENI_SLC500.46E.AA46E_AD20_DEWPT"

We have removed the "nsu=Industrial Gateway OPC Server ;" from the node ID and changed it manually to "ns=2;s=46E_ENI_SLC500.46E.AA46E_AD20_DEWPT".
Using this node ID there is no error and we are able to read the value.

My question is: how can we get the node ID without the "nsu=Industrial Gateway OPC Server ;"?

Thanks.

Michael

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

Moderators: support
Time to create page: 0.064 seconds