How can I build code for a Level-2 M S-function block in Simulink such that it runs on the xPC real-time target?
2 ビュー (過去 30 日間)
古いコメントを表示
Hello and thanks for reading this. I have a problem building a custom block for the xPC real-time target system. This block was developed entirely in .m code as a Level-2 M S-function and hence requires a .tlc file that describes the algorithm to be provided. My question is: is there any way I can auto-generate this .tlc file? Writing it from scratch seems like a very bad idea specially that the algorithm is complex and makes calls to three other external functions which are also written in .m. This means that I not only have to manually write the code for the S-function but also for the three other external functions which basically requires the repetition of work done in a previous master thesis. The other approach I tried was to use the S-function builder to create the .tlc and .c files, but for some reason it does not like receiving structs as dialogue parameters, which is what the algorithm is based on. Is there no work-around that alleviates this .tlc problem and allows me to build my function such that it can be downloaded to the xPC target? Thanks a lot for all your help and support.
Regards; Nawal
0 件のコメント
回答 (1 件)
Kaustubha Govind
2013 年 7 月 3 日
If your MATLAB code only uses functions/constructs supported for code generation, it looks like the MATLAB Function block might be a better option for you.
3 件のコメント
Kaustubha Govind
2013 年 7 月 8 日
Could you please paste a portion of the code you put in the MATLAB Function block around the lines where the error occurs?
参考
カテゴリ
Help Center および File Exchange で Target Computer Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!