Using Realtime UPD to Send a string

2 ビュー (過去 30 日間)
Brian Donlan
Brian Donlan 2022 年 9 月 4 日
コメント済み: Jan Houska 2022 年 9 月 5 日
How do I send a string using the Disktop realtime UPD send block
I am using the string compose to build a NMEA like string
I want to send this to a remote computer which is listening
I do not know how to setup the realtime UDP send block to send a string.
I have tried a raw string and a string to ASCII conversion
Thanks
Brian

回答 (2 件)

Jan Houska
Jan Houska 2022 年 9 月 5 日
Hi Brian,
for an example how to send formatted text over UDP using Simulink Desktop Real-Time, please see the sldrtex_streamio shipping example. You just need to change the protocol to UDP, see the sldrtex_packetio example for that.
Good Luck, Jan

Brian Donlan
Brian Donlan 2022 年 9 月 5 日
this example does not show how to configure the UDP streaming block to accept a string or ascii input
thanks
brian
  1 件のコメント
Jan Houska
Jan Houska 2022 年 9 月 5 日
Hi Brian,
The sldrtex_streamio example does exactly that. Please open the Stream Output block dialog and you will see a format string similar to what you have posted. You do not use the Compose block at all. Instead, you send the numeric values directly to the Stream Output block and use the format string that is a parameter of the block.
Good Luck, Jan

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

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by