Check if Connected in External Mode in Simulink
조회 수: 2 (최근 30일)
이전 댓글 표시
I'm using Simulink in combination with TwinCAT (but this question is, I think, not only applicable to TwinCAT). In order for it to work, I build my Simulink model to 'TwinCAT.tlc' target, 'run' it in TwinCAT and use Simulink External Mode to connect to it and control it.
My problem now is that the model controls a robot, and, for safety, I want the robot to be turned off as soon as the connection between Simulink and TwinCAT is broken (and I also want to enable/disable logging based on the connection state).
Hence the question: Is there any way to get into Simulink the current state of connection between Simulink and TwinCAT (or any other target)? I think that it must be a Simulink block that directly outputs it in the model; a Matlab callback function could probably check it, but as soon as the connection is broken it is not able to send any information to the running Simulink executable (since the connection is broken), so that's not good enough.
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Block Libraries에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!