I am proud to announce the arrival of R2008b. Simulink,
Stateflow, and Real-Time Workshop have many important new capabilities to
explore. If you have not yet downloaded the
latest release log in and check it out. Look over the Highlights
of R2008b web page for an overview of this release.
Here are some links to the release notes for Simulink, Stateflow
and RTW.
For the next few weeks, I will provide some introductions to
these new capabilities right here. Let me know what questions you have about
the new release and I’ll try to answer those too.
I am moving a project that is compose of a simulink model translated to C then to DLL using the R2007B suite of Mathworks software. This DLL is used in Matlab codes using loadlibrary and related function. All is fine in R2007B
I tried to produced the DLL using RTW 2008B and it actually produced the DLL but would not worked with the existing m codes. teh code below is NOT working.
This is my second question for today. Thanks for your patience. I really like the new OOP syntax in Matlab that was introduced in R2008A. I am wondering if this has a flow through effect in Simulink.
At the moment I only know of arrays being passed (by the connecting lines) in Simulink models. For structures I have to use Bus Creator. Is it possible now to pass class objects (by the connecting line) in Simulink? If so can you please send me the reference on how to do this?
Seth: my application is very much similar to Ric’s. Excepting that I go from a simulink model of a complex power system– which runs very well in continuous time domain to discretized version–also works well, then to fixed point version using IQmath blocks then to generate code for the c2000 embedded processor. The basic task of the model is to get 3 phase AC voltage & convert it to DC output by generating 6 switching signals.
It seems that in the process, somehow, timing relationship of the switching signals gets scrambled when the code is run in TMS320F2812 processor real time. All switching signals seem longer in duration, and skewed.
This has brought up the question of how exactly Simulink runs a model, impact of “sampling” time”, how different math blocks are treated during execution & how all this math is translated in the embedded code. Is it possible that the model runs through various blocks at different times–because it cannot do computations concurrently for blocks that the underlying math expects to be– & thus dilates the timing relationship?
Yet I know this approach ought to be implementable. So there must be some better way of organizing the model blocks so that the timing relationship is maintained & RTW signals come out with desired properties seen in the model.
How do I find out about this type of approach for creating RTW code from the virtual world of the model?
Any help will be highly appreciated.
-robin gangopadhya
Leave a Reply
About
Seth Popinchalk is an Application Engineer for The MathWorks. He writes here about Simulink and other MathWorks tools used in Model-Based Design.
Hi there Seth,
I am moving a project that is compose of a simulink model translated to C then to DLL using the R2007B suite of Mathworks software. This DLL is used in Matlab codes using loadlibrary and related function. All is fine in R2007B
I tried to produced the DLL using RTW 2008B and it actually produced the DLL but would not worked with the existing m codes. teh code below is NOT working.
ipRtwMdlPrams = libpointer(’Parameters_SingleClasRemCrystEml’, RtwMdlPrams);
I check the library is loaded and check that an instance of ‘Parameters_SingleClasRemCrystEml’ symbol is actually exported in the DLL.
Do you have any idea what can be happening?
Thank you vrey much.
Kind regards,
Ric Pascual
Object-Oriented Programming In Simulink
Hi there Seth,
This is my second question for today. Thanks for your patience. I really like the new OOP syntax in Matlab that was introduced in R2008A. I am wondering if this has a flow through effect in Simulink.
At the moment I only know of arrays being passed (by the connecting lines) in Simulink models. For structures I have to use Bus Creator. Is it possible now to pass class objects (by the connecting line) in Simulink? If so can you please send me the reference on how to do this?
Thank you very much.
Kind regards,
Ric
Seth: my application is very much similar to Ric’s. Excepting that I go from a simulink model of a complex power system– which runs very well in continuous time domain to discretized version–also works well, then to fixed point version using IQmath blocks then to generate code for the c2000 embedded processor. The basic task of the model is to get 3 phase AC voltage & convert it to DC output by generating 6 switching signals.
It seems that in the process, somehow, timing relationship of the switching signals gets scrambled when the code is run in TMS320F2812 processor real time. All switching signals seem longer in duration, and skewed.
This has brought up the question of how exactly Simulink runs a model, impact of “sampling” time”, how different math blocks are treated during execution & how all this math is translated in the embedded code. Is it possible that the model runs through various blocks at different times–because it cannot do computations concurrently for blocks that the underlying math expects to be– & thus dilates the timing relationship?
Yet I know this approach ought to be implementable. So there must be some better way of organizing the model blocks so that the timing relationship is maintained & RTW signals come out with desired properties seen in the model.
How do I find out about this type of approach for creating RTW code from the virtual world of the model?
Any help will be highly appreciated.
-robin gangopadhya