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.

Extract host or ip address from OPC url string

More
08 Sep 2020 12:13 - 08 Sep 2020 12:16 #8871 by support
Hello,
I do not understand what you want here.

As far as we (and OPC, and COM, and DCOM) is concerned, "Tunneller:10.10.10.05:Matrikon.OPC.SecurityGateway.1" is the ProgID of the server - which the server vendor has chosen to be formatted in rather special way, but that's their choice.

If it happens to contain somehow encoded IP address of something, we have no way of telling that this is the case. For us (and OPC, and COM, and DCOM) it is just an opaque ProgID string for which there are no general parsing rules.

And the fact that the host comes out is empty is correct. It would be nonempty if the URL has looked something like "opcda://myhost/Tunneller:10.10.10.05:Matrikon.OPC.SecurityGateway.1".

In this particular case, the tunneler has a "local" OPC server, that's what you are connecting to - and that's why the host is empty, and that's why they have encoded the "true" host in the ProgID - but again, that does not concern us.

Regards
Last edit: 08 Sep 2020 12:16 by support.
The following user(s) said Thank You: Andriy

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

More
08 Sep 2020 11:52 #8870 by Andriy
Hello,

As the title states, how can host or ip address be extracted from the string that is passed into ServerDescriptor class, and then into EasyOpcDa/EasyOpcUa clients' methods?
ServerDescriptor object contains various properties including Host and Uri object. Not sure about simple scenarios, but in our more complex case, the host is set to empty string and the only thing that is separated from the input string is the prefix - "opcda:\\".

Here is the example that needs to be parsed:
"opcda:/Tunneller:10.10.10.05:Matrikon.OPC.SecurityGateway.1"
Most properties in ServerDescriptor object have either "opcda" part or "Tunneller:10.10.10.05:Matrikon.OPC.SecurityGateway.1", but none show the "10.10.10.05" IP address. Is there any way to get the actual host or IP address, Be that with EasyOpc library or any third-party library?

Best regards,
Andriy

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

Moderators: support
Time to create page: 0.051 seconds