How can I input data in real time?
이전 댓글 표시
I have a C++ program that spits out data from an instrument. It can not be embedded in Matlab. I need a way to stream the data into matlab/simulink in real time.
I have used a text file method, but it only runs at about 100 Hz. It seems opening and closing the file takes too long. I need my program to run at 10Khz.
Is there any way to get data into Matlab this quickly? Perhaps some type of port emulation thing? Some type of direct read and write from memory?
댓글 수: 2
Suneesh
2014년 2월 24일
1. Does the C++ program offer some kind of an API? You could use that from MATLAB/Simulink perhaps from an S-Function.
2. If the program is able to send out UDP or TCP/IP packets then the Instrument Control Toolbox has features that allows to receive such packets.
Note, Simulink does not run in realtime. You could run a model in "pseudo-realtime" using something like this:
This might not be applicable to you but, we do have real-time products like Real Time Windows target and xPC Target.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 System Configuration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!