"Connect to Target" command from Matlab to Simulink

14 views (last 30 days)
Hello:
I am currently working on a remote laboratory in the area of control theory. I am using Simulink and the Real Time Windows Target to control a Servomotor in a simple PI control scheme.
I am using a Java applet to comunicate via internet with Matlab. The Java applet can obtain data from the Matlab workspace and can also issue commands. With this I can control the simulink model to run, obtain data, and chage parameters as needed.
The only thing I cannot do is to order the Simulink model to _Connect to Target_. For those who are not familiar with this, it is a button that appears on the simulink toolbar. Since I am doing a remote laboratory, I would like to be able to command this button from the MatLab command line (as one can control the Run button).
Thank you for your help,
Eduardo Garcia
  2 Comments
ana molina
ana molina on 3 Jul 2012
Hi Eduardo,
I´m wondering if you know the command to build the simulation from the MATLAB prompt. If I use ctrl+B, or if I click directly on the Incremental Build of my simulation, it works, but if I enter in the prompt: "make_rtw Sim" it gets the following "Error using genMakefileAndBuild (line 1323)".. "Error in rtw_c (line 1245)".
Do you have any ideas?
Thank you very much!
TAB
TAB on 4 Jul 2012
Edited: TAB on 4 Jul 2012
@ana molina
rtwbuild('ModelName');

Sign in to comment.

Accepted Answer

TAB
TAB on 3 Jul 2012
Edited: TAB on 3 Jul 2012
set_param(gcs,'SimulationCommand','connect');
Read from here.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!