Level 2 S function - Initialize Conditions using the block's input signals

Hello, As stated here InitializeConditions, if I want to initialize using the block's input signals I need to do so in the Output function. I did this with "if block.CurrentTime == 0"
The problem now is that at block.CurrentTime == 0 all block.InputPort(x).Data are zero. When does Simulink load the inputs? This happens when I use input from file block or constant block.
Why do the block.InputPort(x).Data at block.CurrentTime == 0 not use the values from my source input block?

 採用された回答

Alexander
Alexander 2014 年 7 月 5 日

0 投票

Found the problem. I had to put "block.InputPort(x).DirectFeedthrough = true;" now it works!

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeBlock and Blockset Authoring についてさらに検索

質問済み:

2014 年 7 月 5 日

回答済み:

2014 年 7 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by