Borrar filtros
Borrar filtros

s function usage error- code generation

2 visualizaciones (últimos 30 días)
Dinesh Guleria
Dinesh Guleria el 25 de Ag. de 2015
Comentada: Yuchen Chen el 5 de Dic. de 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 ?

Respuestas (1)

Varun Bhaskar
Varun Bhaskar el 27 de Ag. de 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 comentarios
Dinesh Guleria
Dinesh Guleria el 28 de Ag. de 2015
Thanks for reply, finally resolved. I was doing something wrong at my side.
Yuchen Chen
Yuchen Chen el 5 de Dic. de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Block and Blockset Authoring en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by