Embedded Coder C-Code Abruf von Daten

조회 수: 10 (최근 30일)
Markus König
Markus König 2024년 8월 7일
답변: Akshat Dalal 2024년 8월 16일
Hallo zusammen,
Ich habe einen einfachen RC-Tiefpass in Simulink (siehe Bild) erstellt und mittels des Embedded-Coder C-Code mit einem zugehörigen Main-File generiert. Ziel ist es das Modell mittels Code abzubilden und die Ausgaben zu erhalten:
Mir stellt sich die Frage, wie ich im generierten Code folgendes einstelle bzw. erhalte:
  • Stopzeit der Simulation (wenn ich den Code richtig lese, dann gibt es keine Abbruchbedingung)
  • Ausgangswerte (z.B. in diesem Fall die Ausgangsspannung/maximale Ausgangsspannung)
Die Eingangswerte sind wenn ich es richtig sehe in der CodeGenerations.c-Datei entalten.
Vielen Dank für jede Hilfe!

답변 (1개)

Akshat Dalal
Akshat Dalal 2024년 8월 16일
Hallo Markus,
Leider bin ich mit Deutsch nicht vertraut und werde auf Englisch antworten.
The rtw_solver.h and rtw_continuous.h files in the attached 'C-Code.zip' file containing the generated code are used for the execution-spec of the model and contain all related information such as the stop-time, sample-time etc. For more information, please refer the following documentation: www.mathworks.com/help/releases/R2024a/rtw/ug/build-process-file-dependencies.html
The variables corresponding to the input/outputs can be easily found using highlighting feature on the generated code. Please refer the following documentation for more information: www.mathworks.com/help/releases/R2024a/ecoder/ref/modeltocode.html

제품


릴리스

R2024a

Community Treasure Hunt

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

Start Hunting!