How to use external simulation time in simulink?
3 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
回答(1 个)
Fangjun Jiang
2021-3-4
USE "XY Graph" block. X is the received time, Y is the received data.
2 个评论
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 Center 和 File Exchange 中查找有关 Development Computer Setup 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!