"Connect to Target" command from Matlab to Simulink

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 commentaires

ana molina
ana molina le 3 Juil 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 le 4 Juil 2012
Modifié(e) : TAB le 4 Juil 2012
@ana molina
rtwbuild('ModelName');

Connectez-vous pour commenter.

 Réponse acceptée

TAB
TAB le 3 Juil 2012
Modifié(e) : TAB le 3 Juil 2012
set_param(gcs,'SimulationCommand','connect');
Read from here.

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by