Effacer les filtres
Effacer les filtres

Running an Arduino Ontarget simulink file from the workspace

1 vue (au cours des 30 derniers jours)
Bardia
Bardia le 18 Juin 2013
Hi There,
I'm trying to execute my on-target simulink file entirely from the workspace. I remember for a previous A2D card all I had to do was do something like this.
set_param('Lab3hardOne','SimulationMode','external');
set_param('Lab3hardOne','SimulationCommand','connect');
set_param('Lab3hardOne','SimulationCommand','start');
pause(10);
set_param('Lab3hardOne','SimulationCommand','stop');
set_param('Lab3hardOne','SimulationCommand','disconnect');
I'm not sure, where I even came up with the code to do this as it was few years ago since used the code. I'm guessing there is something different, or a little tweak that I might have to do to get this working for an Arduino (mega).
Any suggestion or references would be greatly appreciated.
Thanks in advance!
  2 commentaires
Kaustubha Govind
Kaustubha Govind le 18 Juin 2013
Do you mean that you want to download the model onto the Arduino, or do you simply want to run a model on the host machine in external mode? (Note how you set SimulationMode=external in your code). Also, what version of MATLAB are you on?
Bardia
Bardia le 18 Juin 2013
I will be using both 2012B and 2013a.
I want to do both if possible. For example, this will be used to communicate with an Arduino which will be connected to a servo motor.Say if I want to change the gain of the system 5 times, I rather not have to hit the run button 5 times. Rather Run a for loop in a script, and have all the results at the end..

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Arduino Hardware dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by