Seeing error-The block 'ABCblock/xyz' has a discrete sample time that does not match the sample time 0.02 of the If block 'ABClocl/xyx/IF'.

7 ビュー (過去 30 日間)
jenny
jenny 2023 年 9 月 19 日
回答済み: Govind KM 2024 年 9 月 10 日
Hello All,
Seeing an error in simulink "The block 'ABCblock/xyz' has a discrete sample time that does not match the sample time 0.02 of the If block 'ABClocl/xyx/IF'. controlling its execution.
Solver settings are Variable step/auto
Can anyone let me know suggestions on how to resolve this error?

回答 (1 件)

Govind KM
Govind KM 2024 年 9 月 10 日
Generally, setting “Sample Time” in “If-Action” subsystems is not recommended as it can cause sample rate transition to be implicitly mixed up with block algorithms. This can often lead to ambiguity and confusion in Simulink models. The below link can provide more information on this:
To set “Sample Time” for the ‘If” block, all blocks in the “If-Action” subsystem must execute at the same rate as the driving “If” block. To meet this requirement, set the “Sample Time” for each block to either inherited (-1) or the same value as the “If” block sample time, which seems to be 0.02 in this case. For details on the execution of an “If-Action” subsystem, you can refer to the documentation:
Hope this is useful to you.

カテゴリ

Help Center および File ExchangeGeneral Applications についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by