The Matlab OPC UA Client does not connect to the OPC UA Server (OPC CoDeSys V3)

2 次查看(过去 30 天)
Why the client doesn't connect to the server.? I thought I did everything according to the instructions in the help. Who has an idea?
MatlabOPC.JPG
  2 个评论
Jonas Hillenbrand
Jonas Hillenbrand 2020-3-11
Same problem here:
I'm running a raspberry Pi with Codesys Image and the OPC UA Server on the Pi is correctly configured and can be reached and browsed with UA Expert.
But the OPC UA Client from MATLAB fails to connect to server!
Any help would be appreciated...
Greetings
Jonas
Srijith Vijay
Srijith Vijay 2024-2-27
Hi Aschmann, Jonas,
Which MATLAB version are you using? This issue could be happening due to the server taking more time to respond to the connection request. I'd suggest logging the OPC UA packets using an application like Wireshark to see if/what the OPC UA server returns in response to the connection request. This could help root cause the issue.

请先登录,再进行评论。

回答(2 个)

Srinivasarao Kamala
Hi,
Try to make your connection "Trust" in OPC UA aerver. Then it will work.

Thomas Pursche
Thomas Pursche 2025-7-22
Hi all,
I encountered a similar problem. I wanted to connect to an OPCUA server that was running on a different machine. Connection via different OPCUA client like Matrikon or UA Expert or something like this were no problem, but with my Matlab application no change.
The first thing is connection via opcua('opc.tcp://myIPadress:myPort') is not working. The first step is to change it in the following:
opcua( obj.Host,obj.Portnum)
The next issue is that when now browsing via opcuaserverinfo, the server cannot find any Endpoints. No Endpoints no connection. The reason seems that Matlabs Toolbox is currently not capable of resolve Hostname other than localhost, also IP adress not working.
The solution is go to C:\Windows\System32\drivers\etc
Open the hosts file with a text Editor and write your IP adress and then your Hostname in the file like this
myIPAdress MySuperServerHostname
Afterwards Matlab is directly able to make a connection, no restart needed.
Best regards,
Thomas

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by