How can I input data in real time?
19 views (last 30 days)
Show older comments
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 Comments
Suneesh
on 24 Feb 2014
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.
Answers (0)
See Also
Categories
Find more on Development Computer Setup in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!