필터 지우기
필터 지우기

How can I collect data from two different sources simultaneously?

조회 수: 6 (최근 30일)
Shion
Shion 2019년 3월 13일
답변: Dhanashree Mohite 2019년 4월 8일
I have two streams of data that I would like to acquire simultaneously (at different rates):
1) Arduino for IMU (USB)
2) Image Acquisition toolbox to acquire frames from ultrasound machine (USB)
I tried a parfor loop to run separate functions for each stream but keep getting an error saying: "Error: Select correct COM Port where Arduino is connected". The functions run fine independently. Is there a way that I can acquire data from both sources simultaneously?

답변 (1개)

Dhanashree Mohite
Dhanashree Mohite 2019년 4월 8일
As per my understanding, you can use the Parallel Computing Toolbox's SPMD feature to do this. The other alternative is to do time-slicing, where asynchronous reads would be performed using the 'bytesavailablefcn' callback.
Please refer below MLAnswer links for more understanding:

카테고리

Help CenterFile Exchange에서 Data Acquisition Toolbox Supported Hardware에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by