s function usage error- code generation
조회 수: 3 (최근 30일)
이전 댓글 표시
My s function is build with SfunctionBuilder block from already existing c source code & tlc file is also generated for it. It takes two nubers as input & output the sum of two numbers.
void add(unsigned char *ip_1,unsigned char *ip_2,unsigned char *result)
{
*result = *ip_1 + *ip_2;
}
I have integrated a matlab s-function in my model. I am getting following error while generating code, for the model.
Error: Simulink Coder Error in block: "one_mdl_extention/One Model/S-Function Builder", block type "S-Function": Block output output_1 uses custom storage class, level 2 but the compliance level of this block is only 1; use a different block or a different custom storage class, level 1 or lower
I have made a simple c function & used s-function builder to create s function, now how can i decide it is a level-1 or level-2 s function ?
What is causing this error ? How to resolve this error ?
why my c source code is converted into level-1 s function, by s function builder block ?
댓글 수: 0
답변 (1개)
Varun Bhaskar
2015년 8월 27일
Hi,
There is a bug in Simulink 7.8 (R2011b) in the error message produced when advanced storage classes are used in blocks that do not support advanced storage classes. There are no workarounds. Are you working with R2011b?
댓글 수: 2
Yuchen Chen
2017년 12월 5일
Would you mind sharing what you did wrong? I keep seeing this error but could not find any hints anywhere. the wired thing is the error happens pretty randomly, I'm using exactly the same blocks in a couple similar occasions, the error showed several times, but not all the time.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!