Read from multiple ports simultaneously

조회 수: 4 (최근 30일)
Nir Raviv
Nir Raviv 2016년 11월 1일
댓글: Walter Roberson 2022년 11월 15일
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
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개)

Kadir Tolga Dogukanli
Kadir Tolga Dogukanli 2019년 3월 24일
I am facing with the same problem, did you find the solution?

Mohammed Ammad
Mohammed Ammad 2022년 11월 15일
could you share your code
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 11월 15일
https://www.mathworks.com/matlabcentral/answers/310129-read-from-multiple-ports-simultaneously#comment_685126

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

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by