TLC code generation from block parameters as defines

7 visualizaciones (últimos 30 días)
Timo
Timo el 27 de Mayo de 2013
Is it possible to create defines from Simulink block variables using BlockTypeSetup TLC-function?
I would like to use model parameter as #define in C:
#define ACC_LIMIT_THRESHOULD (block box parameter value here)
  • Using constant text works:
%openfile buffer
#define ACC_LIMIT_THRESHOULD 123
%closefile buffer
< %LibCacheDefine(buffer)>
  • Adding text into the stream using <% syntax woun't work...
%assign block_parameter_value = 2
%openfile buffer
#define ACC_LIMIT_THRESHOULD < %block_parameter_value>
%closefile buffer
< %LibCacheDefine(buffer)>

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 29 de Mayo de 2013
I think that should be:
#define ACC_LIMIT_THRESHOULD %<block_parameter_value>
and not:
#define ACC_LIMIT_THRESHOULD <%block_parameter_value>
Same thing with the call to LibCacheDefine.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by