How to use the C code generated from Real time Workshop in Visual Studio?

1 vue (au cours des 30 derniers jours)
archana b m
archana b m le 29 Nov 2012
Commenté : Dzung le 27 Août 2014
I have created a very simple add model which takes two constants and returns their sum. Then I generated the C code using Real Time Workshop with grt.tlc as the target by referring to the following link "http://blogs.abo.fi/alexeevpetr/2011/11/18/simplified-building-simulink-generated-c-code-in-visual-studio/ ". I now want to use this code in Visual Studio 2010. But i have more than 300 errors popping up. I followed the approach specified in the link " http://blogs.abo.fi/alexeevpetr/2011/09/30/building-simulink-generated-c-code-in-visual-studio/" But the problem is that i do not have MATLAB installed in the system where the Visual Studio is present. I have however got the .h and .c files required which are mentioned in the link above.I am also new to Visual Studio. Please provide the solution in step wise procedure, so that i can follow it easily.

Réponse acceptée

Kaustubha Govind
Kaustubha Govind le 29 Nov 2012
I think the easiest way is to select the System target file (in the Configuration Parameters window's Code Generation pane) that corresponds to "Create Visual C/C++ solution file" - this should create a Visual Studio project (solution file) that you can directly load into Visual Studio. Alternatively, see Relocate Code to Another Development Environment.
  5 commentaires
Kaustubha Govind
Kaustubha Govind le 9 Mai 2013
Modifié(e) : Kaustubha Govind le 9 Mai 2013
Woody: I think the "Create Visual C/C++ solution file" option was added in R2010b, that's probably why you don't see it.
Dzung
Dzung le 27 Août 2014
Hi all, can anyone tell me how to setup visual studio and MATLAB/Simulink to do software in the loop simulation?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Simulink Coder dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by