Simple Data Exchange over Serial Interface?

I'm trying to find a simple but flexibel way communicating/exchanging data using the serial interface of my microcontroller and Embedded Coder but not by using External Mode. My work so far is similar to the "Embedded Coder Support Package for Arduino" available on MathWorks.com (but I'm not using Arduino). That means I can read/write over the serial interace.
The end-product is a simple digital controller used for demonstration and the idea behind the serial interface is to change controller parameters (i.e. Simulink parameters) without rebuilding the whole model and also keeping the generated code short and simple. But: the type of controller can vary heavily and so the (tuneable) paramters vary (in name and/or type). For the sake of convenience the number of different parameters is small (like 10 or something).
At the moment I'm thinking about possible solutions. I thought about creating a custom block that allows accessing Simulink parameters by their name/identifier. This block is controlled by a user-defined simple protocol over the serial interface (like 's K_P 100 u' for "set parameter K_P to 100 and update immediately"). This would requier that tuneable parameters are accessable over a dictionary by their name. But im quite sure Embedded Coder is able to do so.
The question: is this approach a good idea or are there other possible and better ways? I'm not looking for a complete solution but some hints or ideas.
Thank you very much.

Risposte (0)

Categorie

Scopri di più su Deployment, Integration, and Supported Hardware in Centro assistenza e File Exchange

Richiesto:

il 5 Gen 2014

Modificato:

il 5 Gen 2014

Community Treasure Hunt

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

Start Hunting!

Translated by