Real Time Stream from OpenBCI into Simulink
Hello,
I am wondering if anyone has a Simulink model example on how to stream the data from our OpenBCI board into Simulink?
We have tried a multitude of different things to try and get this working but have had no luck. We are able to get a live stream into MATLAB but unfortunately writing a script for what we want to do with our signals in REAL TIME is much more tedious than obtaining a simple stream into simulink.
Simulink will allow us to do many different things with major ease with the signals we accquire from our board. Any sort of direction or example from those that have achieved this will help.
Thanks,
Zach
Comments
Hello, have you found the solution? I just meet with the same problem
@guliang98 and @zschmidt, hi.
Since Simulink and Matlab are apps from the same company (MathWorks), I believe you can use Matlab calls inside Simulink designs to call out to the Brainflow library. Brainflow supports Matlab.
https://brainflow.org/
Gu, I merged your duplicate thread with this existing one of this same title.
William
William,
Thank you so much! I will try it !
Gu Liang
hello,
did anyone manage to solve it?
I tried to combine the matlab code but I cant convert it or use it in a simulink model.
best regards
Hi Mobile,
I'm not a Simulink user, but it appears that what you need is the External Mode of Simulink. This allows importing data streams from outside the simulation.
https://www.mathworks.com/help/slrealtime/gs/simulink-external-mode-interface.html
https://www.mathworks.com/help/supportpkg/armcortexa/ug/activate-the-external-mode-feature.html [one such example]
Also see these related links that mention streaming from Matlab to Simulink.
https://www.google.com/search?q=Stream+data+from+MATLAB+to+Simulink
William
How to stream live EEG data in real time from Cyton board to Simulink Desktop Real-time. The guidance document only introduces MATLAB, but doesn't mention Simulink Desktop Real-time. We use the dongle as a connection between Cyton board and our PC, but that doesn't work in Simulink Desktop Real-time. Is there another way? Thank you very much!
@tsuki, hi.
I merged your Simulink question into this existing thread on the same subject. See some of the previously posted comments for suggestions.
William
How to use UDP to transfer EEG data from OpenBCI GUI to simulink in real time?
@tsuki, I merged your new thread into this existing thread.
To send the data stream in UDP format, use the GUI networking widget:
https://docs.openbci.com/Software/OpenBCISoftware/GUIWidgets/#udp
William
When we use brainflow to transmit EEG data from Cyton board to Simulink, is there any other device that supports the connection of board and PC? If there is no such device, how can the data be transferred from Cyton board to Simulink in real time?
@tsuki, hi.
Can you PLEASE post Simulink related questions / comments on this EXISTING thread, so that Simulink related topics are concentrated here. Another advantage is that each new post emails all previous commenters. In case they might have answers.
re: your new thread "Which devices does Brainflow support? Using brainflow how can the data be transferred to simulink?"
Brainflow is documented at the below websites. Devices listed on the last page:
https://brainflow.org/
https://brainflow.readthedocs.io/en/stable/
https://brainflow.readthedocs.io/en/stable/SupportedBoards.html [devices supported]
re: how to transfer data into Simulink.
Have you looked at the comment above from October 9, regarding "External Mode"? By writing an 'external' interface module in Matlab, that talks to the Brainflow library, it seems likely you will be able to stream from that Matlab routine into Simulink.
https://brainflow.readthedocs.io/en/stable/Examples.html#matlab
William