Clear Filters
Clear Filters

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

3 views (last 30 days)
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?

Answers (1)

Vidip Jain
Vidip Jain on 1 Sep 2023
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:

Categories

Find more on AUTOSAR Blockset in Help Center and File Exchange

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!