Clear Filters
Clear Filters

Running an Arduino Ontarget simulink file from the workspace

1 view (last 30 days)
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 Comments
Kaustubha Govind
Kaustubha Govind on 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 on 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..

Sign in to comment.

Answers (0)

Categories

Find more on Arduino Hardware in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!