Wie kann man einen Speicher in Simulink erstellen?

3 次查看(过去 30 天)
Hi Zusammen
Ich habe in Simulink Diagnosefunktionen für ein Entwicklungsfahrzeug geschrieben und jetzt sollen die ausgespuckten Fehler in eine Art Fehlerspeicher kooirdiniert werden . wüsste jemand , wie sowas zu realisieren wäre? brauche schnell Hilfe
Gruß
Mark

回答(1 个)

Deep
Deep 2024-8-27
Hi Mark,
Ich werde die Anfrage auf Englisch beantworten.
You can leverage several tools and techniques within Simulink. Stateflow offers a robust way to implement state machines, allowing you to capture and transition between error states efficiently. With Stateflow, you can design a chart that tracks errors as they occur and retains them in memory.
Moreover, Data Store Memory blocks can be used to create a shared memory space accessible across different parts of your model, ideal for logging errors from various sources.
If you require more complex logic, consider using MATLAB Function blocks or a custom S-Function, where you can write custom code to handle error detection and storage, utilizing persistent variables to maintain error states across simulation steps.
Here are some resources from the MathWorks documentation that might help you further:
  1. Stateflow - https://www.mathworks.com/products/stateflow.html
  2. Data Store Memory - https://www.mathworks.com/help/simulink/slref/datastorememory.html
  3. MATLAB Function Block - https://www.mathworks.com/help/simulink/slref/matlabfunction.html
  4. Initialize Persistent Variables in MATLAB Functions - https://www.mathworks.com/help/simulink/ug/initialize-persistent-variables.html
  5. MATLAB S-Function Basics - https://www.mathworks.com/help/simulink/s-function-basics-matlab.html
I hope this helps!

Community Treasure Hunt

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

Start Hunting!