How can I get a conditionally-executed Rte write call in the generated code with AUTOSAR?

8 views (last 30 days)
I am currently trying to write conditionally to the Rte for my AUTOSAR model, and I am not sure what are the mechanisms to do this is Simulink. 
Sometimes I obtain results as follows, in which the value is specified inside of the if-else logic, but the Rte write is not executed conditionally (this happens for both implicit and explicit DataAccessMode, ie. both Rte_Write() and Rte_IWrite()): 
if ((tmp == 1) {\n\n rtDW.Value = 1U;\n\n} else {\n\n rtDW.Value = 1U;\n\n}\n\nRte_IWrite_Runnable_10ms (rtDW.Value);\n}
How can I get the Rte call inside of the if-else clause?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 13 Jan 2022
BLOT: It is not currently possible to generate conditional Rte write calls based on conditions in a Stateflow chart. There are available semantics in Simulink (eg. If-else blocks) that support conditional writes. 
  • When using If-else blocks for the semantics of the model, the Rte write can be generated inside the condition.
    • In order to achieve this, all the outports up to the root-level have to be marked as virtual
  • When using a Stateflow chart to set the condition in the model, there is a limitation to obtain the Rte write call conditionally. 
    • In this case, even setting the outports as virtual will not generate the call inside of the condition. 

More Answers (0)


No tags entered yet.




Community Treasure Hunt

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

Start Hunting!