time delay in s function

hello everyone
for my simulink model i need a variable time delay, therefore i tested it by generated a s function out of it because i need the whole model as a s function. by comparing the two results i got something very strange: the generated s function provides me an amplified and phase delayed signal. does someone know the reason why this is happening? how can this problem be solved?
kind regards

2 件のコメント

Kaustubha Govind
Kaustubha Govind 2012 年 6 月 21 日
Are you saying that the results from the generated code did not match those from simulation? How about if the compare the results with the model in "Normal" simulation mode and "Accelerator" mode? The Accelerator mode is similar to generating an S-function for the model and running it.
andreas
andreas 2012 年 6 月 22 日
thank you for your fast replay!
yes the results from the generated code and the simulink block don't match!
i made a screenshot of the model and the result: http://www.evernote.com/shard/s219/sh/c44c17ae-cf68-4b52-b235-bd67f91f9f05/6673a69c61fe0fdfddcb9666fd49543f
maybe it is now easier what the problem is! the blue framed model is a generated s function of the red one.
i tried also to run it in the accelerator mode but there were no changes at the result

サインインしてコメントする。

 採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 6 月 22 日

0 投票

Andreas: Since you seem to have narrowed down the issue to a very simple model, I would highly recommend that you report this to MathWorks Tech Support with the model so that they can determine whether this is a bug. It's hard for me to judge anything without looking at the model, so I think it might be best if Tech Support investigates this further.

2 件のコメント

andreas
andreas 2012 年 6 月 28 日
thanks for your help!
the tech support found the following solution: increase the buffer size of the variable time delay block and generate afterwards the s function :-)
Kaustubha Govind
Kaustubha Govind 2012 年 6 月 29 日
Great! Thanks for posting their resolution!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by