OPCUAサーバーの​EndpointUr​lのポートがプログラ​ムで指定したポートと​ずれる原因を教えてく​ださい

1 visualización (últimos 30 días)
千仁
千仁 el 30 de En. de 2025
Editada: 千仁 el 5 de Feb. de 2025
MATLABで、下記のプログラムを実行しました。
uaserver = opcua('opc.tcp://abcde:51311');
connect(uaserver,'username','password');
作成されたクライアント変数の中身は以下のようになりました。
Hostname: 'abcde'
Port: 51311
EndpointUrl: 'opc.tcp://Devicegateway:51310'
EndpointUrlのポート番号がプログラムで設定した値と異なるため、所望の信号の値を取得することができません。
原因は何でしょうか?

Respuestas (1)

Kojiro Saito
Kojiro Saito el 31 de En. de 2025
OPCのエンドポイントが複数あるためにEndpointUrlが指定したポート番号と異なるのかと思われます。
opcuaserverinfo 関数を使ってエンドポイントの情報を動的に取得する方法を試してみてはいかがでしょうか?
serverInfo = opcuaserverinfo("abcde");
uaserver = opcua(serverInfo(1)); % またはserverInfo(2)
connect(uaserver,'username','password');
  1 comentario
千仁
千仁 el 5 de Feb. de 2025
Editada: 千仁 el 5 de Feb. de 2025
ご回答いただきありがとうございました。
serverInfo = opcuaserverinfo("abcde");
こちらを実行しても、1つの情報しか取得できず(serverInfo(2)が存在しない)、こちらのポートが51310となっていました。
MATLAB側で、"abcde"のエンドポイントとしてポート51310しか認識していないように考えられるのですが、何か設定することによりポート51311も認識させることは可能でしょうか?

Iniciar sesión para comentar.

Etiquetas

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!