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.

How to add new Reference Type

More
18 Oct 2019 17:45 #7843 by support
Hello.

In OPC UA, all reference types are identified by reference type IDs, which are just OPC UA Node Ids. The reference types are not really identified by "names". Names only exist to assist humans in writing and reading the documentation (there are BrowseNames and DisplayNames in OPC UA, too, but they do not uniquely _identify_ anything, they always has to work in context of other :parent" node).

What you see in UAReferenceTypeIds class may look like this is a list of reference type "names", but they all just return UANodeId-s. The "names" comes form the OPC UA specification, in this case, because the purpose of the UAReferenceTypeIds is to make it easier for users to obtain the Node Id of the reference type when typing in the code, without having to hard-code the Node Id, which in case of standard reference types is always an integers, so it's not really something people can remember or easily work with.

So, any other reference type is not different : It will be represented by Node Id again, not by any "name". In your case, you can test whether the returned ReferenceTypeId equals to the reference type Id you want, and it may look something like this:
if (nodeElement.ReferenceTypeId == new UANodeId("http://statusenterprise.com/StatusServer/User", 4008)
{
    ///
}

I do not understand how the reference type Id could be "different" in other OPC UA server. If the same reference type is meant to be used over multiple servers, then it must have the same Node Id. For example, when OPC Foundation defines a reference type, whenever somebody wants to use, he will use it - and it will have the same Node Id. If somebody has defined your "HasAliasTarget", it should have given it a Node Id, that is: a namespace URL, and an identifier (integer, string, GUID, or opaque). And it must stay the same always, otherwise it would not be the same reference type.

If the Node Id of your reference type "changes", then you cannot look for answer it in the OPC UA specifications, and you cannot look for answer in the toolkit you use (QuickOPC, in this case). You need to resolve that problem with whoever "defines" such reference type.

Best regards

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

More
17 Oct 2019 14:34 #7840 by Alberto_OVT
Thank you Sir, I'm going to try to express myself better. I have a node and I get his references, one of this references is like in the picture, it does not have name for ReferenceType because it does not exist in ReferenceTypeIds class, so instead of "HasAliasTarget" it has and IdNode:

https://ibb.co/Wn3ktQv

So my question is, how could I identify this type of reference for all cases? Because the IdNode that has here the "HasAliasTarget" reference type is only for the current opc ua server but will be different for any other opc ua server. Is what I say correct?

Thank you

Best Regards
Attachments:

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

More
17 Oct 2019 11:45 #7836 by support
Hello,
I am not sure if I understand what is the question, so some more explanation might be needed.

If what you want to do is to recognize which of the references returned is your "HasAliasTarget", all you need to do is compare the returned ReferenceTypeId (which is a node Id, represented in UANodeId instance) with the node id of your "HasAliasTarget" reference type.

If you are only interested in those references, you should rather specify that as an input to the browsing - and then the browse would *only* return these references.

Best regards

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

More
17 Oct 2019 09:25 #7835 by Alberto_OVT
Hello, I have an issue and I need some help.

When I'm browsing nodes from opc ua server, I have seen that there is a reference type in the server that the UAReferenceTypeIds class does not have and I need it to identify this kind of reference when browsing. The reference is "HasAliasTarget", Is there any way to add it to the model or how could I identify this reference type when I get it?

Thank you!

Best Regards

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

Moderators: support
Time to create page: 0.049 seconds