필터 지우기
필터 지우기

Simulink Fixed Step Size Discrete Compiler - two different step sizes in .cpp file?

조회 수: 2 (최근 30일)
Hi Everyone,
When I generate my code from the Simulink Coder (2011a), in my .cpp file I get
290 /* Model step function for TID0 */
291 void TEST_step0(void) /* Sample time: [0.04s, 0.0s] */
292 {
293 /* (no output/update code required) */
294 }
295
296 /* Model step function for TID1 */
297 void TEST_step1(void) /* Sample time: [1.0s, 0.0s] */
I want the step size to always be 0.04s...I set the solver to this value, and I'm not sure why it is giving me a second sample size.
thanks, B.

채택된 답변

Kaustubha Govind
Kaustubha Govind 2011년 7월 13일
You probably have blocks in your model that have a sample time of 1s (blocks in a model with a fixed-step solver can have a sample-time that is a multiple of the solver step-size). Look at the sample-time colors in your model to find the blocks and assign them to have a sample-time of 0.04s.

추가 답변 (1개)

Daniel
Daniel 2012년 2월 22일
I had this problem too, but I used the advanced search to look up the blocks with property "Sample time" with value "1".

카테고리

Help CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by