Opc_Ua_any device unable to connect to a server using Hostname

I have spoken to my local colleague, who has spoken to support and apparently the solution is to use the following configuration on both client and server.
Client and server have to have different host names and the DNS suffix has to be the same and match the local DNS - you can ask your local administrator for this or it can be found in windows settings once you’re on the same network.
image
image
We were then advised to use the function blocks for the connection instead of OpcUa_any device. It was enough to use the solutions from OpcUa_Sample on both sides and we were then able to connect to the server with hostname (opc.tcp://server:4840).
For anyone dealing with this issue in the future, OpcUa_Sample project is a sample that comes with AS and the sample tasks in there were enough to solve this. For more complex solutions, information about the OPC UA function blocks can be found:
AS 4 Help: OPC UA - Client FB - Server FB
AS 6 Help: OPC UA - ClientFB - Server FB
Or you can use this library to make your life easier. Cheers to our colleagues from Spain!
To conclude my thought: use OpcUa_any device for only really simple straightforward applications and if possible use FB and a bit of coding :smiley:.

Thank you everyone for your help, I do appreciate it! Happy coding!

3 Likes