I encounter a problem during connecting the OPC Toolbox to an OPC server.
I use a B&R PLC as server which works, as there is another client using this as server. However, when I try to connect through the OPC Toolbox to the server I get the following warning and error:
Warning: Some endpoints could not be retreived:
B&R Embedded OPC-UA Server and Client: The hostname could not be resolved.
In opc.ua.getServerInfo (line 68)
In opcuaserverinfo (line 29)
Error using opc.ua.Client/fetchEndpoints (line 625)
The hostname could not be resolved.
Error in opc.ua.Client/connect (line 409)
errorCode = clnt.fetchEndpoints;
The warning is given when asked for server information. The error is given when trying to connect to the server.
But when I put the endpoint in with uaClient.EnpointUrl: 'opc.tcp://hostname:port', I encouter following error:
Error using asyncioimpl.Channel/init
Endpoint Url must be a non-empty string.
Error in asyncio.Channel (line 105)
customProps = obj.ChannelImpl.init(options);
Error in opc.ua.Channel (line 17)
obj@asyncio.Channel(deviceName, converterName, varargin{:});
Error in opc.ua.Client/connect (line 466)
clnt.AsyncChannel = opc.ua.Channel(options, [Inf,0]);f true
So, MATLAB is clearing the string I put in the EndpointUrl.
When using UaExpert as tool to check the connection, I encouter a similar warning: Discovery GetEndpoints on opc.tcp://br-automation:4840 failed (BadHostUnknown). However, UaExpert is able to supress this warning and connect to the OPC server.
Has anybody encoutered the same problem? Or any suggestions on how-to-fix this problem? I would really appreciate an answer.