Filter löschen
Filter löschen

Running an Arduino Ontarget simulink file from the workspace

1 Ansicht (letzte 30 Tage)
Bardia
Bardia am 18 Jun. 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 Kommentare
Kaustubha Govind
Kaustubha Govind am 18 Jun. 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 am 18 Jun. 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..

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Arduino Hardware finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by