How to influence order of automatic generated C-Code from Simulink Model
이전 댓글 표시
Hallo,
I have a simulink-model containing normal math operations and s-functions as input and outputs to hardware.
Lets say two s-funtions give in1 and in2, a multiplication calculates mult1 = in1 * in2, a s-function writes the value of mult1.
I would expect the following c-code from my model:
/* S-Function (nios_mm_read) Block: <Root>/in1 */
MEM_FAST_READ(simulink_model.in1, short, IN1_BASE);
/* S-Function (nios_mm_read) Block: <Root>/in2 */
MEM_FAST_READ(simulink_model.in2, short, IN2_BASE);
/* product */
simulink_model.Product = simulink_model.in1 *
simulink_model.in2 ;
/* S-Function (nios_mm_write) Block: <Root>/Product */
MEM_FAST_WRITE(simulink_model.Product, short, OUT_BASE);
Unfortunately the order functions is mixed up after generating the c-code from the model, so that, in my minimal example, the multiplication is caclulated, before the actual values are read via the s-functions.
Is there any possibility to influence the order appearance of the blocks in the generated code?
Thanks and regards
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Simulink Coder에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!