OPCUAサーバーのEndpointUrlのポートがプログラムで指定したポートとずれる原因を教えてください
조회 수: 1 (최근 30일)
이전 댓글 표시
MATLABで、下記のプログラムを実行しました。
uaserver = opcua('opc.tcp://abcde:51311');
connect(uaserver,'username','password');
作成されたクライアント変数の中身は以下のようになりました。
Hostname: 'abcde'
Port: 51311
EndpointUrl: 'opc.tcp://Devicegateway:51310'
EndpointUrlのポート番号がプログラムで設定した値と異なるため、所望の信号の値を取得することができません。
原因は何でしょうか?
댓글 수: 0
답변 (1개)
Kojiro Saito
2025년 1월 31일
OPCのエンドポイントが複数あるためにEndpointUrlが指定したポート番号と異なるのかと思われます。
opcuaserverinfo 関数を使ってエンドポイントの情報を動的に取得する方法を試してみてはいかがでしょうか?
serverInfo = opcuaserverinfo("abcde");
uaserver = opcua(serverInfo(1)); % またはserverInfo(2)
connect(uaserver,'username','password');
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!