MATLAB Answers

0

What is the difference between ImplicitReceive and ExplicitReceive in AUTOSAR Code?

What is the difference when changing DataAccessMode for AUTOSAR inputs between ImplicitReceive and ExplicitReceive?

1 Answer

Answer by MathWorks Support Team on 22 Aug 2019
Edited by MathWorks Support Team on 22 Aug 2019
 Accepted Answer

ImplicitReceive: The input is always buffered. So, the input value remains the same in a single execution of the runnable, no matter how many times it is used.
ExplicitReceive: The input is NOT buffered. So, the input value changes whenever it is used within a single execution of the runnable.
As per the AUTOSAR specification:
"Implicit sending and receiving aims at the optimization of computation effort for sender-receiver communication. Instead of executing the full amount of functionality for each call to a send resp. receive API the implicit communication only receives implicitly received values latest before the start of the execution of a RunnableEntity and sends implicitly sent values earliest after termination of the RunnableEntity."
You may find more information on the difference between implicit and explicit sending and receiving in sections 7.5.1.3 and 7.5.1.4 of the AUTOSAR Specification, linked below. Choosing between these two options will depend on your modeling goals.
The generated code for each setting is different. Below is an example of generated code in the two cases.
1) ImplicitReceive
/* Model step function for TID1 */
void Runnable_2s(void) /* Sample time: [2.0s, 0.0s] */
{
/* Update for RateTransition: '<Root>/RateTransition' incorporates:
* DiscreteIntegrator: '<Root>/Integrator'
*/
Rte_IrvIWrite_Runnable_2s_IRV1(rtDW.Integrator_DSTATE);
/* Update for DiscreteIntegrator: '<Root>/Integrator' incorporates:
* Inport: '<Root>/In2_2s'
*/
rtDW.Integrator_DSTATE += 2.0 * Rte_IRead_Runnable_2s_ReceivePort_In2();
}
2) ExplicitReceive
/* Model step function for TID1 */
void Runnable_2s(void) /* Sample time: [2.0s, 0.0s] */
{
real_T tmpRead;
/* Inport: '<Root>/In2_2s' */
Rte_Read_ReceivePort_In2(&tmpRead);
/* Update for RateTransition: '<Root>/RateTransition' incorporates:
* DiscreteIntegrator: '<Root>/Integrator'
*/
Rte_IrvIWrite_Runnable_2s_IRV1(rtDW.Integrator_DSTATE);
/* Update for DiscreteIntegrator: '<Root>/Integrator' */
rtDW.Integrator_DSTATE += 2.0 * tmpRead;
}

  0 Comments

Sign in to comment.