Change and save parameter / variable for next startup on an arduino target using simulink

조회 수: 11 (최근 30일)
Hi guys!
I have an Arduino Mega and want to deploy my Simulink Model on this target so the Model can run on its own without a PC, Matlab etc. In my Model i want to able to change the some settings and save theses changes permanently. The thing is i dont want to save this settings just for the actual runtime but for the next start after the Arduino is shutdown / restarted. What i want to achieve is just to save some values for my model for the next startup, like in a settings menu.
If i am correct i need to change the variables / parameters in the Model workspace. A already tried using the Data Store blocks but, as expected i am loosing the values for the next Start of the Arduino. I also tried to use "Simulink.Paramter" to change the Variables in the Workspace but i did something wrong resulting in:
The 'Simulink.Parameter' class does not support code generation
So my question is: Is it possible to change and save values in my model for the next start of the arduino? And if so how?
Thanks in advance!
Denis

답변 (1개)

Arun Kumar
Arun Kumar 2020년 4월 29일
Hi Denis,
What I understood from your question is that you want to store some data during runtime and read that data during the next/subsequent runs. On mega, this can be achieved by using the onboard EEPROM:
There's no block for EEPROM read/write in the support package, but you can create your own block by following this simple guide:
Hope this helps!
Arun

카테고리

Help CenterFile Exchange에서 MATLAB Support Package for Arduino Hardware에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by