Simulink MPC RTMaps Code Gen Issues

Hello,

We had some issues trying to code-gen the Simulink MPC block. The generated C++ files reference a few structs that aren’t defined anywhere in the code, and looking through the code and the model we’re not sure where the structs are coming from. The image below shows the issues and the model. The model was created by taking an MPC block (without any modifications) and adding inports/outports.

The MPC block can be code generated into C/C++, so we’re not sure why it runs into this issue when trying to code gen for RTMaps.
Any help would be greatly appreciated!

Hello @dparikh,

Thanks for reporting this.
I was able to reproduce this issue. It seems the structures are declared in the model description, but with a ‘Skip’ attribute that wasn’t taken into account on our code template. There was a similar issue with parameters that weren’t tunable.
It is now fixed with version 3.20.5 of the RTMaps Mathworks package, available on our update site (https://support.intempora.com/hc/en-us/articles/115001658369-RTMaps-Updater).
Please let us know if your component generated with this update works as expected.

Thanks!

1 Like

Sorry for the late response, we were testing this out with a few other customized MPC models on our team. They all convert perfectly now.

Thanks a lot for the quick response and help!