Read from multiple ports simultaneously
2 次查看(过去 30 天)
显示 更早的评论
Hi,
I'm trying to read data from three devices simultaneously (2 devices works at 100 Hz and the 3rd at 2000 Hz) and plot the data in real-time using one timer. I'm using 'BytesAvailableFcn' for each port.
When I'm working with each of them separately my code works fine and display the graph perfect but when I'm trying to read from 2 or 3 together I receive odd data and get delays in my plotting.
I think the problem is that the ports interrupt each other. Does anyone have a solution for this problem? by the way I'm not using multi-thread, should I use parallel processing?
Thanks, Nir
1 个评论
Walter Roberson
2019-3-24
How are the devices interfaced? Are they all implemented as Serial Over USB (virtual serial, serial emulation), with all of them being connected to the same USB controller ?
回答(2 个)
Mohammed Ammad
2022-11-15
could you share your code
1 个评论
Walter Roberson
2022-11-15
https://www.mathworks.com/matlabcentral/answers/310129-read-from-multiple-ports-simultaneously#comment_685126
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Target Computer Setup 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!