OPC UA Endpoints error

조회 수: 3 (최근 30일)
Alex Serrat
Alex Serrat 2022년 3월 23일
I am trying out the Industrial Communication Toolbox in matlab to read the datapoints from an OPC UA server running in my PLC. I used the demoUA_browsing file to test, but it gives me errors. The hostname is the IP address of my Beckhoff PLC (which works).
serverList = opcuaserverinfo('opc.tcp://hostname:4840')
responds with:
serverList =
OPC UA ServerInfo 'TcOpcUaServer@hostname':
Connection Information:
Hostname: 'hostname'
Port: 4840
Endpoints: [0×0 opc.ua.EndpointDescription]
Security Information:
BestMessageSecurity: Unknown
BestChannelSecurity: Unknown
UserTokenTypes: {1×0 cell}
but it is not able to retrieve the endpoints... Due to that when I then run the command:
uaClient = opcua(serverList)
I get the following error:
Error using opc.ua.Client/fetchEndpoints (line 684)
The operation timed out.
Error in opc.ua.Client (line 378)
[~, appName] = this(tI).fetchEndpoints;
Error in opcua (line 43)
uaObj = opc.ua.Client(varargin{:});
Error in demoUA_browsing (line 34)
uaClient = opcua(serverList)
I also have UaExpert to make sure that the communication is okay, and it is able to connect and read/write all the values. Any ideas?
  댓글 수: 1
Pete
Pete 2022년 8월 12일
The server name returned from opc.internal.opcUaDiscovery findserver does not match the address in the original opc url. This can happen when the server url is an ipaddress and the server name is an actual name. For a Windows machine the ipaddress can be mapped to a server name in the file called hosts located in C:\Windows\System32\drivers\etc\. You will add something like:
xxx.xxx.xx.xxx <youropcusservername> # source server
That worked for me to resolve the endpoints.

댓글을 달려면 로그인하십시오.

답변 (1개)

MathWorks Industrial Communication Toolbox Team
This issue arises when the OPC UA Server includes certificates with endpoints that cannot be accessed by the client, particularly when the client connects through multiple interfaces.
You can find more info in the below MATLAB Answer:

카테고리

Help CenterFile Exchange에서 Unified Architecture에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by