TCP/IP communication using Simulink- blocs (send/receive) under Real- Time Windows Target

7 次查看(过去 30 天)
Hello community,
I try to connect two PC using Simulink Blocks TCP/ IP send and receive. The Problem is, that I need this communication in Real- Time. I know, that this is not really possible with TCP/ IP, but if it can run under RTWT, then it would have a lower interupt mask and this would be enough for me.
I'm able to applicate the communication under the "Generic Real- Time Target" code generation. If I choose "Real- Time Windows Target", then everything is fine and i get the information:"Successful completion of build procedure for model: **"
The Problem is, that the receive- block has no Data containing and so the scope plots "0" and Matalb displays:"Warning: Simulink cannot upload data to 'sinuskurve/IP Receive' because it has no input ports". With wireshark I can detect, that Data between the two Systems is transmitted.
Now my question: Why there is no Input in the receive- bloc although there is a communication and how can I fix this problem?
I hope there is someone out there, who solved such a problem and can give me advises for my project. By the way: my Matlabversion is 2012b.
Best regards
Juri Romanez

采纳的回答

Jan Houska
Jan Houska 2013-3-28
The IP Send and IP Receive blocks are not usable in Real-Time Windows Target. Instead, please try to use blocks from Real-Time Windows Target library - either Packet or Stream I/O (based on your data format) and the UDP driver.
  2 个评论
Juri
Juri 2013-3-28
Thanks for the answer. I managed to create a communication with the blocks from the RTWT library.
Sorry, that I didn't describe the whole problem. I need to communicate by sending XML- strings. The aim is, to control a KUKA robot with RTWT over RSI- XML. For that I need to send and receive XML- Data with TCP/IP or UDP.
The packet in- and output -block seems to send and receive unformatted binary data. That is a good sign. The question is: Can I send and receive char strings with this blocks? Can you tell me, if this has a chance to succeed? Or do you know, how to send char strings with the usage of this RTWT blocks?
Thanks for help.
Jan Houska
Jan Houska 2013-3-29
编辑:Jan Houska 2013-3-29
Use Stream Input and Output blocks instead. They are designed for formatted text data and are better suited for XML. Please see the rtstreamio example.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Development Computer Setup 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by