OPC UA fails to connect in Simulink but connects in Matlab

17 ビュー (過去 30 日間)
Shahab
Shahab 2023 年 9 月 20 日
コメント済み: Srijith Vijay 2024 年 3 月 13 日
I am trying to access an Allen-Bradley PLC through OPC. The server (factoryview linx) is on a remote computer. I was able to connect to the server using Matlab commands but when I try to use Simulink "Industrial Communication" OPC Config block, I am getting the following error.
Does anybody have an idea how to fix this?

回答 (3 件)

Sivapriya Srinivasan
Sivapriya Srinivasan 2023 年 9 月 25 日
編集済み: Sivapriya Srinivasan 2024 年 3 月 1 日
Hi Shahab,
I understand that you are receiving an error indicating that the Simulink OPC Config block is unable to retrive the server list
This error message arises when the simulink model does not have necessary permissions to access the OPC Server
To resolve this issue you can try the following steps:
1.Make sure that the user running the Simulink model has the required permissions to access the OPC server.
2.Verify that the firewall settings on both the computer running the Simulink model and the remote computer hosting the OPC server allow communication over the required network ports
3.Since you mentioned that you were able to connect to the server using MATLAB commands, try using the same commands within a MATLAB script or command window to verify that the connection can be established successfully. This will help isolate the issue and confirm that the problem lies specifically with the Simulink OPC Config block.
Hope this helps!

Srijith Vijay
Srijith Vijay 2024 年 3 月 1 日
Hi Shahab,
Just a heads up, the "OPC Config" section in the Industrial Communication Toolbox is only compatible with the OPC DA protocol. Could you check on which OPC protocol the PLC is using? Is it OPC DA or OPC UA?
If you're working with OPC UA, you should be able to use the OPC UA MATLAB APIs within a MATLAB function block for PLC interactions in Simulink. This is because, as of R2023b, we don't have OPC UA blocks for Simulink.
But if it's OPC DA that's being used, make sure the DCOM settings are set as per the instructions on this page: Set Up Industrial Communication Toolbox Software for OPC - MATLAB & Simulink.

liang sen
liang sen 2024 年 3 月 12 日
hello,I got the same problem,how do you solve it at last?thank you
  1 件のコメント
Srijith Vijay
Srijith Vijay 2024 年 3 月 13 日
Hello Liang, to try to help you further, could you share more ino on your workflow?
  • What OPC UA server are you connecting to?
  • Are you using OPC DA or OPC UA communication?
  • Have you tried discovering/connecting to the server using the MATLAB APIs?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeServer Connection and Browsing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by