Error in code generation for model with S-function

Hi,
Please offer your suggestions.
I try to pass a Simulink (R2008a) subsystem to customer without source model. So I used Realtime Workshop to generate a S-function with ert.tlc target.
The s-function block was inserted into a model. It worked well in Simulation mode. while in code generate phase, the following error occurred:
Error using ==> tlc_c at 133 Block '.../10ms loop/Fault Diagnosis/Fault Diagnosis_sfcn' is a non-inlined s-function, which is not supported with the current configuration. Consider selecting the support 'non-inlined s-functions' ERT option. >>
Is there any way to fix the error. I did not check 'non inlined s-function' option in s-function generation. Can Realtime Workshop generate an inlined S-function from a Simulink subsystem.
I appreciate your help.

Risposte (1)

That is what you want, right? You build the S-function for your model, give it to your customer so they can use it for simulation but you don't have to disclose the source model. If they can generate the code from the S-function, then it defeat the purpose.

6 Commenti

Thanks for the answer. I try to find a way to share information without source model. Customer needs to be able to generate code for targer processor. Hopefully the generated code from s-functon is not easily understandable. What is a typical way for automotive OEM and supplier share information, generated code, object code, or s-functoin?
If your customer needs to generate code for target processor, you'll need to give them your source model. When the S-function is created, it basically generates C code from the model and then compile it into .dll (or .mex) file. You could give them the C source code or without giving it. But remember, the C code generated for the S-function is just one form of the Code. Code for a target processor might need a different form of the code. That's why RTW has those ert.tlc or grt.tlc and etc. One way to truly hide your algorithm is to generate the code according to their target processor and give them the compiled .obj file. Of course, the proper boundary interface needs to be nailed down first.
Hi,
Thanks a lot for your information. As you said, giving object file to my customer may be the best option.
dSpace also suggested this,
http://www.dspace.de/shared/support/faqpdf/faq022.pdf
But I am not sure what changes need to be made in customer model side. He is using RTW embedded coder.
I appreciate if you can provide link or reference to a sample model.
Another way I am thinking is that I duplicate the configuration of my customer, and compile the model
into c-code, and give the source code to my customer. Not sure if the change on my cutomer side is minimal.
I do not worry too much about generated code. The algorithm is quite complicated. Reverse engineering
is not so easy. But I just do not want to give away the source model.
Regards.
If you give your customer the .obj file, they won't be able to run simulation. They don't need to generate code for your part. They just need to compile their code and link your .obj file to build.
If you don't worry about sorce C code, then you can work with your customer to find out the exact RTW configuration to generate the C code for them. For simulation, you can build S-function as your did. Or use protected model reference. Check model reference for more details.
Hi,
If I give my customer the generated C code or object file of my subsystem, how can my customer include them in his code generation environment? e.g., in his model, should he include an dummy subsystem with same inputs and outputs? How can he instruct Realtime Embedded Workshop to bypass this dummy subsystem, and use external code or object file? Please provide more details on this topic. Thanks.
They don't need to generate code from your model because you've generated the code for them. There are different ways to generate code from their model without your model, depending on their model structure. Of course, you need to define the interface between your model and their model ahead of time. If I ask you to provide me with a C function with two inputs and one output, all are single data type with name as in1, in2 and out, you certainly can write me this C code function or generate the C code from your model.

Accedi per commentare.

Richiesto:

il 7 Ott 2011

Community Treasure Hunt

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

Start Hunting!

Translated by