s function usage error- code generation

3 Ansichten (letzte 30 Tage)
Dinesh Guleria
Dinesh Guleria am 25 Aug. 2015
Kommentiert: Yuchen Chen am 5 Dez. 2017
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 ?

Antworten (1)

Varun Bhaskar
Varun Bhaskar am 27 Aug. 2015
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 Kommentare
Dinesh Guleria
Dinesh Guleria am 28 Aug. 2015
Thanks for reply, finally resolved. I was doing something wrong at my side.
Yuchen Chen
Yuchen Chen am 5 Dez. 2017
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.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Simulink Coder finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by