How to introduce a functional call as very first or very last statement in AUTOSAR model

1 回表示 (過去 30 日間)
Martin Viereckel
Martin Viereckel 2022 年 9 月 22 日
回答済み: Vidip Jain 2023 年 9 月 1 日
I have a AUTOSAR Simulink model for which i have to introduce a Client/Server Operation call as very first and very last statement. Via priority setting I am able to model the call at beginning and end but still some more code like reading Inports or writing state variables is generated before or after the statements.
Is there anoher possibility to control the function call sequence?

回答 (1 件)

Vidip Jain
Vidip Jain 2023 年 9 月 1 日
I understand that you want to introduce a Client/Server Operation call as very first and very last statement via priority setting. Also, you are able to model the call at beginning and end but still some more code like reading inports or writing state variables is generated before or after the statements.
In AUTOSAR models, controlling the function call sequence is essential for achieving the desired behaviour. To ensure that certain function calls occur at the very beginning and very end of your system, you can employ the following techniques:
  1. Start/End of Runnables: In AUTOSAR, Runnables are the units of work that can be executed by an RTE (Run-Time Environment). You can create Runnables that encapsulate the function calls you want to execute at the start and end. By assigning appropriate priorities to these Runnables, you can control their execution sequence.
  2. Control Flow of Runnables: To further control the sequence, you can design the control flow of Runnables. You can use the "Start on Event" feature to trigger certain Runnables at the beginning or end. This can be particularly useful for initialization or shutdown routines.
  3. Inter-Runnable Variables (IRVs): Use Inter-Runnable Variables to communicate between different Runnables. By setting the dependencies between Runnables using IRVs, you can ensure proper synchronization and control the execution sequence.
Refer to this documentation for more information:

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by