Clear Filters
Clear Filters

Embedded Coder C-Code Abruf von Daten

1 view (last 30 days)
Markus König
Markus König on 7 Aug 2024
Answered: Akshat Dalal on 16 Aug 2024
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!

Answers (1)

Akshat Dalal
Akshat Dalal on 16 Aug 2024
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

Products


Release

R2024a

Community Treasure Hunt

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

Start Hunting!