UDP Receive in DESKTOP REAL-TIME

8 ビュー (過去 30 日間)
yamamoto
yamamoto 2020 年 11 月 17 日
回答済み: Altaïr 2025 年 4 月 14 日
I want to use the block in the attached figure1 in DESKTOP REAL-TIME.
But a warning will appear as shown in Fig2.
I want someone to tell me the DESKTOP REAL-TIME version block.
  1 件のコメント
yamamoto
yamamoto 2021 年 3 月 11 日
The UDP signal is delayed by 500ms with respect to the angular trajectory of the encoder.
There is no missing data.
I’m using the “Packet input block” in DESKTOP REAL-TIME now.
Is there a way to solve this problem?

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

採用された回答

Diego Kuratli
Diego Kuratli 2020 年 11 月 17 日
For Simulink Desktop Real-Time, you can use
  2 件のコメント
yamamoto
yamamoto 2020 年 11 月 23 日
編集済み: yamamoto 2020 年 11 月 24 日
Thank you for answering.
yamamoto
yamamoto 2021 年 3 月 11 日
The UDP signal is delayed by 500ms with respect to the angular trajectory of the encoder.
There is no missing data.
I’m using the “Packet input block” in DESKTOP REAL-TIME now.
Is there a way to solve this problem?

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

その他の回答 (1 件)

Altaïr
Altaïr 2025 年 4 月 14 日
The issue you're experiencing might be related to the internal buffer of the UDP driver, which stores unread packets until its capacity is reached. It's crucial to understand that while the Packet Output block sends a packet at each time step regardless of input changes, the Packet Input block reads only one packet per time step, even if several packets are waiting in the buffer. This can create a situation where a long queue of unprocessed packets gives the appearance of a delay, as packets arrive faster than they are processed.
Here are some strategies to consider:
  • Adjust Sample Time: Set the sample time of the Packet Input block to be shorter than the expected period of new packet arrivals. Utilize the Data Ready port to check when a new packet has arrived.
  • Discard Older Messages: If reducing the sample time isn't possible and only the newest message is needed, use the Data Ready port of the Packet Input block to discard older messages. Place the Packet Input block inside a While Iterator subsystem, using the Data Ready port to drive the While condition. This setup ensures messages are read one-by-one, displaying only the latest data at the output. Remember to set all blocks inside the While Iterator subsystem to a sample rate of -1, as they inherit their sample rate from the While subsystem.
For more detailed information, this MATLAB Answer might be helpful: https://www.mathworks.com/matlabcentral/answers/865295

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by