Learn AUTOSAR-ARXML-C with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
AUTOSAR ARXML Component Definition
<?xml version="1.0" encoding="UTF-8"?>
<AUTOSAR>
<AR-PACKAGES>
<AR-PACKAGE>
<SHORT-NAME>MySwc</SHORT-NAME>
<SW-COMPONENT-TYPE>
<SHORT-NAME>MyComponent</SHORT-NAME>
<RUNNABLES>
<RUNNABLE-ENTITY>
<SHORT-NAME>MyRunnable</SHORT-NAME>
</RUNNABLE-ENTITY>
</RUNNABLES>
</SW-COMPONENT-TYPE>
</AR-PACKAGE>
</AR-PACKAGES>
</AUTOSAR>
A simple AUTOSAR ARXML snippet defining a software component with a runnable.
2
AUTOSAR C Runnable Implementation
/* AUTOSAR Runnable Implementation */
#include "Rte_MyComponent.h"
void MyRunnable(void)
{
/* Example: read input port, process, write output port */
int input = Rte_IRead_MyRunnable_InputPort();
int result = input * 2;
Rte_IWrite_MyRunnable_OutputPort(result);
}
C implementation of an AUTOSAR Runnable defined in ARXML, adhering to safety-critical C coding guidelines.