Simulink: How to interpret received UDP data/packet?

20 ビュー (過去 30 日間)
Guoguang Zhang
Guoguang Zhang 2017 年 10 月 6 日
回答済み: Suze Zhang 2017 年 10 月 9 日
I use simulink udp receive block to receive UDP packet from a PC. The packet sent by the PC is according to a C header file. It contains a structure with a lot of signals of different data type. E.g., signal 1 uint8, signal 2 double, etc. The data is also begin with a header stating who is the sender and what size is the data.
After receiving the raw data, how can I use simulink to interpret the data?

採用された回答

Suze Zhang
Suze Zhang 2017 年 10 月 9 日
Hi Guoguang,
You can consider using a Byte Unpack block to interprest the received UDP packets. There is a shipped Simulink example model that demonstrates this.
To open the model, execute the following command in MATLAB Command Window:
>> udpsendreceiveA
For more information regarding this example, please refer to the link below:

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by