How to simultaneously and continuously run multiple codes?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am trying to continuously run a simulation from MATLAB to Arduino(to receive and send information) and also have a GUI to interact with. The problem I am running into is trying to have one part of my code continuously running, call it A, and be able to have a simulation occur, call it B, while the A is still running. I looked into parallel computing and being able to have A and B running along with sending and receiving information from Arduino, but I believe there is something I am missing to simulate this. Has anyone ever tried this before? Also let me know if you need more detailed explanation.
My original plan was to create 6 scripts/functions: 1 be the communication portal for Arduino to MATLAB, the next would be my GUI, then my original code that always has to be running, the other three would be simulations preformed one at a time.
Thanks! (I currently have R2013a)
0 commentaires
Réponses (1)
Walter Roberson
le 15 Mai 2014
Instead of having your code continually running to communicate with the Arduino, use serial port callbacks to talk to it as needed. See ReceivedBytesFcn and related serial properties.
0 commentaires
Voir également
Catégories
En savoir plus sur Instrument Control Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!