Simulink, receive UDP packet wrong port width

2 ビュー (過去 30 日間)
Svenh
Svenh 2023 年 10 月 30 日
編集済み: Stefanie Schwarz 2023 年 11 月 9 日
To First state my current situation
In the following picture is my Simulink Model
The Error I get:
The Port width of the receive UDP BLock should be 25 but in the error it says that the byteunpack block only receives a input port width of 2.
My settings for the blocks are the following:
receive UDP packets Block (The IP-adress is filled in normaly, just not for the picture)
receive Block
Byte Unpack Block
What i tried
-changed the portwidth to different setting in the receive UDP Block but i get the same error
-tried to implement a selector Block, still got the same error
Thank you very much

採用された回答

Stefanie Schwarz
Stefanie Schwarz 2023 年 11 月 9 日
編集済み: Stefanie Schwarz 2023 年 11 月 9 日
When the Simulink Real-Time UDP blocks are used with Simulink messages, they automatically create a "UDP_Packet" bus definition in the base workspace. It seems that for the "Data" signal in that bus, the length is specified as 2, although it should be 25 as per the "Receive Width" specified in the UDP Receive block.
To fix this, just delete the "UDP_Packet" variable in the base workspace and update your model, so that the bus definition gets regenerated with the right length for the payload data.

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by