Simulink Coder

11 ビュー (過去 30 日間)
James Dwulit
James Dwulit 2011 年 5 月 4 日
I have a working Simulink model and when I try to generate code I get "Error during code generation: S-function unhandled exception occurred." I don't have an S-function in the model -- it is all simulink blocks, no custom code. Any ideas?
  2 件のコメント
Jarrod Rivituso
Jarrod Rivituso 2011 年 5 月 4 日
Do you get that message in a dialog window? Is there any additional information printed in the command window?
Kaustubha Govind
Kaustubha Govind 2011 年 5 月 5 日
In addition, run this on your model to see if any of the library blocks have S-functions under their masks:
find_system(bdroot, 'LookUnderMasks', 'all', 'FollowLinks', 'on', 'BlockType', 'S-Function')

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

回答 (3 件)

James Dwulit
James Dwulit 2011 年 5 月 5 日
I had a N-delay block which is listed as an S-function. When I removed that the error left too. Does this mean I cannot use an N-delay block when developing code?

Kaustubha Govind
Kaustubha Govind 2011 年 5 月 5 日
N-Delay doesn't sound like a Simulink Library block. Did you mean the Integer Delay block? If yes, you shouldn't have any trouble generating code for this (also this block isn't an S-function).
Maybe you got the block from a third-party blockset and it is not supported for code-generation?
If you are sure that the block is from a Simulink library, can you give us the name of the library?

James Dwulit
James Dwulit 2011 年 5 月 6 日
Yes, it was the Simulink Discrete Blockset Integer Delay. I did not think it was an s-function since I did not write any code for it. However if you open the block set and call up Block Parameters it clearly states it is an s-function. I am a n00b so I may have something else set wrong to cause an error. Anyway I am working around it.
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2011 年 5 月 6 日
Oops. You're right. The Integer Delay block is indeed an S-Function. However, it does support code-generation, so the error that you see is unexpected. It would be great if you are able to demonstrate the issue with a simple model and report this to Tech Support. Perhaps there is a code-generation bug with using the block under certain circumstances (like input datatype, size, etc.)

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

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by