How to interact with a SLDRT (Kernel mode) simulation using TCP/IP

3 ビュー (過去 30 日間)
Howard Loewen
Howard Loewen 2024 年 12 月 5 日
回答済み: Jan Houska 2024 年 12 月 10 日
Hello everyone,
We have developed a hardware in the loop real time simulation with Simulink Desktop Real time and the model interfafces with the hardware using several serail com ports currently. We would also like to have the ability to interact with the model via TCP/IP to change certain parameter values during the runtime and we are not sure how to achieve this.
We have been using Simulink Real time (2015b) that runs an equivalent model on a target PC and our exsisting windows based application can interface with the model running on a xPC via TCP/IP. We were wondering if there is an easy way to use the existing windows application to interact with the new model that runs in SLDRT (Kernel mode).
We would ideally like to retrieve parameters from the model, change the values of certain parameters in real time etc.
Any help would be appriciated in this regard.
Thank you

回答 (1 件)

Jan Houska
Jan Houska 2024 年 12 月 10 日
Hello Howard,
Simulink Desktop Real-Time is designed in such a way that the real-time code runs on the same computer as MATLAB and Simulink. That is, the host and the target share the same computer hardware. If you prefer the host and the target to be two separate machines, please consider Simulink Real-Time instead.
That said, it is possible to communicate with a Simulink Desktop Real-Time model using TCP/IP. You can use the Packet Input or Stream Input block (or their Output variants), according to your data format preference. However the received data acts as a signal (as opposed to parameter) and you must design the model to respond to that signal. Also, the processing of the TCP/IP-sent and received data on the remote computer is entirely up to you, although you will be probably able to use App Designer to build an app for that.
Good Luck, Jan

カテゴリ

Help Center および File ExchangeDevelopment Computer Setup についてさらに検索

製品


リリース

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by