필터 지우기
필터 지우기

Simulink: Introduce delay with UDP Send/Receive

조회 수: 7 (최근 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 CenterFile Exchange에서 Development Computer Setup에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by