Prev: DAQ parallel processing
Next: Fourier transform
From: Klaus on 17 Jun 2010 13:48 Hi, I want to eliminate empty initialization functions in code generated by RTW embedded coder (see example below). Any hint on how to eliminate these empty initialization function are wellcome. Thanks Klaus ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Example: Given a simple Simulink model (say "ADD.mdl") with following diagram: Two inputs driving a Sum block, the sum block driving an outport block: In1 ---- (SumBlock) ----- Out1 In1 -----/ Further given a simple Simulink model (say "TEST_ADD" using two model blocks referencing the ADD.mdl. Then the RTW embedded coder, generates following code: ADD.c: ... /* Model initialize function */ void mr_ADD_initialize(void) { /* (no initialization code required) */ } void TEST_ADD_initialize(void) { ... /* Model Initialize fcn for ModelReference Block: '<Root>/Model' */ mr_ADD_initialize(); /* Model Initialize fcn for ModelReference Block: '<Root>/Model1' */ mr_ADD_initialize(); }
From: Riccardo on 18 Jun 2010 06:12 "Klaus " <noreply(a)abcd.efg.com> wrote in message <hvdn4m$cec$1(a)fred.mathworks.com>... > Hi, > > I want to eliminate empty initialization functions in code generated by RTW embedded coder (see example below). Any hint on how to eliminate these empty initialization function are wellcome. > > Thanks > Klaus > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Example: > Given a simple Simulink model (say "ADD.mdl") with following diagram: > > Two inputs driving a Sum block, the sum block driving an outport block: > In1 ---- (SumBlock) ----- Out1 > In1 -----/ > > Further given a simple Simulink model (say "TEST_ADD" using two model blocks referencing the ADD.mdl. > > Then the RTW embedded coder, generates following code: > ADD.c: > ... > /* Model initialize function */ > void mr_ADD_initialize(void) > { > /* (no initialization code required) */ > } > > void TEST_ADD_initialize(void) > { > ... > /* Model Initialize fcn for ModelReference Block: '<Root>/Model' */ > mr_ADD_initialize(); > > /* Model Initialize fcn for ModelReference Block: '<Root>/Model1' */ > mr_ADD_initialize(); > } Hi, version of tools and RTW target used would probably help people understand better what are you trying to do. It may be worth checking Start/BlockInit function options. Although dead code like that should be optimized-out by the compiler, that looks a bit funny anyway, to say the least , as standard generated code for a Simulink built-in block.
|
Pages: 1 Prev: DAQ parallel processing Next: Fourier transform |