Real-Time-Workshop access to Simulink Model

I have exported a Simulink model to C using Matlab R2012a and initialized the model by calling 'void Model_initialize(void);'. When I exported the same model using R2012b it seems that this function was split into 'void Model_initialize(void);' and 'RT_MODEL_Model *Model(void);'.
A.1) In R2012b, do I need to call 'Model(); Model_initialize();' to initialize? (For example the initialization of the static model mapping information ('Model_InitializeDataMapInfo()') moved to 'Model()' in R2012b).
A.2) If so, why is 'RT_MODEL_Model *Model(void);' not in the header 'Model.h'? (Furthermore it seems to be part of the "classic call interface", according to source code comments, which indicates that I don't have to use it, but then the model mapping is never setup.)
Thank you for your consideration.

2 Commenti

What is the System Target File selected in the Configuration Parameters > Code Generation pane?
GRT (Generic Realtime Target)

Accedi per commentare.

Risposte (1)

Kaustubha Govind
Kaustubha Govind il 20 Nov 2012
Ah. I see that you have probably configured Code Generation>Interface>Data exchange>Interface to "C API" on the Configuration Parameters window. I just tried this with a demo model (rtwdemo_counter) in R2012a, but see that rtwdemo_counter_InitializeDataMapInfo is indeed called in rtwdemo_counter_initialize. I wonder if what you're seeing has something to do with your model? In that case, it might be best to report this issue to MathWorks Technical Support to see if they have a solution.

Categorie

Scopri di più su Simulink Coder in Centro assistenza e File Exchange

Prodotti

Tag

Richiesto:

il 6 Nov 2012

Community Treasure Hunt

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

Start Hunting!

Translated by