matlab - s function usage error- code generation -
my s function build sfunctionbuilder block existing c source code & tlc file generated it. takes 2 nubers input & output sum of 2 numbers.
void add(unsigned char *ip_1,unsigned char *ip_2,unsigned char *result) { *result = *ip_1 + *ip_2; }
i have integrated matlab s-function in model.
i getting following error while generating code, 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 compliance level of block 1; use different block or different custom storage class, level 1 or lower
how resolve error ?
i have made simple c function & used s-function builder create s function, how can decide level-1 or level-2 s function ?
short answer: use level 2.
level 1 s-function block still exists in matlab legacy reasons, level 2 improved version. there nothing can implement in level 1 s-function can not implement in level 2 s-function. other way round, there many features missing in old level 1 s-function.
there 1 case, level 1 s-functions have advantage on level 2 s-functions, in simulation run faster. users never create models of complexity, simulation time matters.
Comments
Post a Comment