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.
답변 (1개)
Fangjun Jiang
2011년 10월 7일
0 개 추천
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
Sean
2011년 10월 8일
Fangjun Jiang
2011년 10월 8일
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.
Sean
2011년 10월 8일
Fangjun Jiang
2011년 10월 8일
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.
Sean
2011년 10월 10일
Fangjun Jiang
2011년 10월 10일
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.
카테고리
도움말 센터 및 File Exchange에서 Callable Function Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!