Apply C code for real-time Speedgoat operation

조회 수: 11 (최근 30일)
Mantas Dabrovolskas
Mantas Dabrovolskas 2023년 6월 5일
편집: Mantas Dabrovolskas 2023년 6월 7일
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
Dimitri MANKOV 2023년 6월 5일
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
Mantas Dabrovolskas 2023년 6월 6일
편집: Mantas Dabrovolskas 2023년 6월 7일
Thanks, I'll check it out.
Well it did not give me any usable information. I tried different blocks S-function (wrapper) - still same error.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Target Computer Setup에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by