I am new to AUTOSAR and I would like to call a RTE function to get a specific value from one SWC to another SWC. The RTE_Write is performing by one SWC 1 runnable with 10 msec task and RTE_read is performing by another SWC 2 with 15 msec task. I am using sender receiver interface to implement this concept.
SWC 1 :
Task_10msec()
{
eg:
int val = 0;
val = val +1 ;
Rte_write_test_port(val);
}
SWC 2 :
Task_15msec()
{
eg:
int val = 0;
Rte_read_test_port(&val);
}
Now here i am facing the problem is that RTE_read value is not sync with RTE_Write value because of the runnable timing (SWC 1 is 10 msec and SWC 2 is 15 msec). I would like to know, is there any way to design the interface/ any approach to get the exact read value in SWC 2 after writing from SWC 1?
You could try to add a
QueuedReceiverComSpecon the receiver port and set thequeueLengthto e.g. 2. You should then useRte_Receiveinstead ofRte_ReadAPI and read until it returnsRTE_E_NO_DATAin order to get all values provided by the other component.