Simulink: Introduce delay with UDP Send/Receive

3 ビュー (過去 30 日間)
Arun Adiththan
Arun Adiththan 2017 年 7 月 6 日
回答済み: Akhilesh Mishra 2017 年 7 月 10 日
I'm building a client/server-type subsystem in a control system application using UDP Send/Receive blocks in Simulink. Data x is sent to the server via UDPSend block which is then processed at the server that returns output y.
Currently, I've both the client (a Simulink model) and the server (processing logic return in Java) resides in the localhost. Therefore, the packet exchanges essentially take near-zero time. I'd like to introduce network delay such that the packet exchanges take a varying amount of time (say due to changes in bandwidth availability), effectively simulating a scenario where the server node is located in a different geographical location.
Could someone guide me on how to achieve this? Thanks.

採用された回答

Akhilesh Mishra
Akhilesh Mishra 2017 年 7 月 10 日
It is not possible to simulate the network delay after sending as the data has already been sent out of the host. However, we can add a 'Variable Delay' block after the 'UDP Receive' block to simulate the delay and observe the response of the control system application. Please refer to the attached sample demo model (created using MATLAB R2017a).
The documentation link to the 'Variable Time Delay' block can be found in the link below - https://www.mathworks.com/help/physmod/sps/powersys/ref/discretevariabletimedelay.html

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by