Apply C code for real-time Speedgoat operation
古いコメントを表示
I am trying to simulate a MCU which is programmed via C. I have tried C Caller and it does return the function's result to Scope.
I also sent a constant to Speedgoat's analog output - it outputed the required voltage.
But I cannot merge these two - when I connect C Caller output to Analog Output, I get 'code generation information file does not exist'
Is it even possible to do so? My goal is to use the original controller C code in Matlab, to simulate it. That means I would need a main() loop, which calls other functions and these functions do something (like sending and receiving CANbus messages or reading analog input).
Whole simulation consists only of three elements - C Caller, Speedgoat setup and Speedgoat analog output.
回答 (1 件)
Dimitri MANKOV
2023 年 6 月 5 日
0 投票
Hi Mantas,
The integration of external C/C++ code in Simulink Real-Time is documented here. Please note that your original code might need to be adjusted in order to work with Simulink Real-Time/Speedgoat.
I hope this is helpful!
Best,
Dimitri
1 件のコメント
Mantas Dabrovolskas
2023 年 6 月 6 日
編集済み: Mantas Dabrovolskas
2023 年 6 月 7 日
カテゴリ
ヘルプ センター および File Exchange で Target Computer Setup についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!