Running an Arduino Ontarget simulink file from the workspace

1 次查看(过去 30 天)
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 个评论
Kaustubha Govind
Kaustubha Govind 2013-6-18
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 2013-6-18
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..

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Arduino Hardware 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by