Change parameters depending on Configuration Parameters

1 view (last 30 days)
Hi all
I have a controller model that I am referencing to in three different harnesses:
  • Simulation (laptop simulations)
  • Real-time (rapid prototyping set-up)
  • Code generation (for production deployment)
There is a fairly lengthy start-up procedure implemented in Stateflow which is needed to initialize the hardware on the real-time set-up and in the production code. In Simulation however, this functionality is not needed and could be skipped. But since it is implemented in the controller model which is reused in all three harnesses, the simulation will execute it and it takes too long to simulate. Especially since the plant model contains power electronics, the step time is small and simulations take a long time.
Would it be possible to for example use a condition in Stateflow which is true when the TLC file is grt.tlc, but false when it is something else like ert.tlc or slrt.tlc? This way I could skip certain stateflow conditions in the simulation. Then I hope the generated code does not contain traces of this functionality.
As an alternative I was thinking about using the Data Dictionaries functionality. That the value of a certain parameter is true for the Simulation harness but false for the other harnesses. But I am afraid it will make the code more messy and could lead to potentially mistakes when by mistake loading simulation parameters on the test bench for example.
With kind regards,
Jonas

Answers (0)

Categories

Find more on Real-Time Simulation and Testing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!