필터 지우기
필터 지우기

How to use external simulation time in simulink?

조회 수: 1 (최근 30일)
Jan Theiss
Jan Theiss 2021년 3월 4일
댓글: Fangjun Jiang 2021년 3월 16일
Hello :)
I have sensors and pumps that are connected to a board which has a tcp connection to simulink. Since round times from simulink to the board and back are too long and flickers a little, the control algorithm is executed on the board. It sends data back to simulink after every execution (20 ms) and a time stamp at which the data was sent. I would like to use this time stamp as simulation time to have the data shown correctly in a scope even if they arrived with different latency or maybe even different order. Is there any way to achieve that?

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2021년 3월 4일
USE "XY Graph" block. X is the received time, Y is the received data.
  댓글 수: 2
Jan Theiss
Jan Theiss 2021년 3월 16일
편집: Jan Theiss 2021년 3월 16일
That solves the problem of displaying it correctly. But what if other blocks should use that as their simulation time to calculate other things? Maybe by using a shorter sim interval and delay the simulation so that it matches the received time?
It is a little hard to me to find the right way between discrete simulation of continous signals...
Fangjun Jiang
Fangjun Jiang 2021년 3월 16일
That is the "latency" you have to deal with. You can slow down the simulation on the computer or "wait" for the message coming from TCP/IP. But there is no other way better than reducing this "latency" directly if possible.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by