Specify code replacement for Simulink subsystem block

In Matlab 2014b, I have a Simulink model that I'm using to generate code for an embedded application. The code generator only generates code, and I combine that code with some hand-written code to build the project in a separate IDE.
There is a function in the hand-written code that I'd like the model-generated code to be able to call. However, I can't simply import this function into a block, as the function is further connected to external code and data that I don't want in my model. Instead, I want to create a subsystem that models this function using data from a test vector, but have each instance of this subsystem block get replaced by a call to my hand-written function.
This seems to be a good application for a custom code replacement library. However, I haven't been able to get it to work. I created a masked subsystem in a custom library, and put a couple instances of this subsystem in my model. I then created a custom code replacement library with a table with an entry for a custom function. I used the library's subsystem name as the custom function name, matched the input/output argument types to the block, and filled out the replacement function information. But when I use this code replacement library in my project, and generate code, there is no replacement reported in the code replacement report.
Is it possible to specify that each instance of a subsystem from a custom library be replaced by an externally defined function?

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Products

Asked:

on 8 Sep 2017

Community Treasure Hunt

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

Start Hunting!