RTA Knowledge Base


The ResponseOnEvent service provides the possibility to automatically execute a diagnostic service in case a specified event occurs in the server. The client specifies the event (including optional event parameters) and the service (including service parameters) to be executed in case the event occurs.

Per AUTOSAR 4.2.2, response services supported are 0x19 (ReadDTC) with sub-service 0xE (MostRecentConfirmedDTC) for DTC related events and 0x22 (ReadDataByIdentifier) for DID events.

Furthermore, per AUTOSAR 4.2.2, only the following sub-services of ResponseOnEvent are supported (Bold are not supported):

SIDName
0x00StopResponseOnEvent
0x01OnDTCStatusChange
0x02OnTimerInterrupt
0x03OnChangeOfDataIdentifier
0x04ReportActivatedEvents
0x05StartResponseOnEvent
0x06ClearResponseOnEvent
0x07OnComparisonOfValues

This tutorial will take you through configuring ResponseOnEvent with support for each of the above sub-services. We will also configure the Protocol Transmission Type of ResponseOnEvent to TYPE1. This means that the event response will share the same TX PDU as your normal UDS protocol. For more information on the differences between TYPE1 and TYPE2 Protocol Transmission Type, please refer to the AUTOSAR DCM specification.

NOTE: Currently there seems to be a bug in RTA-BSW 3.1 regarding ResponseOnEvent configuration. The workaround will be provided below.

Assumptions

You must have the following ETAS software installed:

  • ISOLAR-AB 4.0.2

  • RTA-BSW 3.1

  • RTA-RTE 6.3.0

  • RTA-OS 5.5.11

  • RTA-OS (Port) x.x.x

  • You already have DCM configure for basic services and the normal communication protocol is already configured.

  • You are familiar with the Response on Event UDS service

Dcm Configuration

  1. First we must configure the service in our DcmDsdServices table. Go to Dcm > DcmConfigSet > DcmDsd > DcmDsdServiceTable and right-click on DcmDsdServices. Select, "Create DcmDsdService". The below screenshot highlights the configurations required. In most configurations, the configuration below will always be the same when using RTA-BSW 3.1:

  2. Now that we have the service configured, we must configure each of the sub-services we need for ResponseOnEvent. Expand out DcmDsdServiceand right-click on DcmDsdSubServices. Select, "Create DcmDsdSubService". Add the following sub-services, and enter the following sub-service IDs.

  3. The ResponseOnEvent service depends on the ReadDTC and ReadDataByIdentifier services when configuring the OnDTCStatusChange and OnChangeOfDataIdentifier sub-services, respectively. Due to this, we must also configure a new DcmDsdServiceTable, which will later be linked to our ResponseOnEvent protocol (configured later).

    Go to Dcm > DcmConfigSet > DcmDsd. Right-click on DcmDsdServiceTables and select "Create DcmDsdServiceTable". Give the table a ShortName of "DcmDsdServiceTable_ROE".

    Next, expand out your new DcmDsdServiceTable, and right-click on DcmDsdServices and select "Create DcmDsdService. Do this two times, one for the ReadDTC service and once for the ReadDataByIdentifier service.

    NOTE: The security and session references might be different depending on your project requirements.

    Next, complete the service configuration for the two services:

    ReadDataByIdentifier:

    ReadDTC:

    The ReadDTC service, also requires the sub-service 0xE (ReportLastConfirmedDTC). Add a DcmDsdSubService and enter in the following configuration:

  4. At this point, our services configuration is complete. We must now complete the DcmDslProtocol for our ResponseOnEvent service.

    Navigate to Dcm > DcmConfigSet > DcmDsl > DcmDslProtocol > DcmDslProtocolRows. Right-click DcmDslProtocolRows and select "Create DcmDslProtocolRow". For the ShortName, enter "DcmDslProtocolRow_ROE" and complete the remainder of the configuration per the screenshot below. Make sure you select your DcmDslProtocolSIDTable that we created above.

    NOTE: Some of these configurations might be different depending on your requirements.

  5. Next we need to configure our DslConnection. However, because we have selected to use TYPE1 Protocol Transmission, we only need to configure the DcmDslResponseOnEvent container, but not the actual TX PDU references. Please use the below screenshot as a reference to configure the DslConnection

  6. Next, we must link the above ResponseOnEvent connection to our Normal UDS connection. Navigate to your existing UDS Protocol, and select the DcmDslMainConnection. Click the DcmDslROEConnectionRef and select your DcmDslResponseOnEvent container.

  7. Now, our service and connections are complete. The next thing we must configure are the specific events our ResponseOnEvent service should respond to. Since we configured both the DTC and DID events in our sub-services, we must also configure these events in our DcmDspRoecontainer.

    Navigate to DcmConfigSet > DcmDsp > DcmDspRoe and fill out the properties per below. Again, these might be different depending on your configuration.

    Expand out DcmDspRoe, right-click on DcmDspRoeEvents and select "Create DcmDspRoeEvent". The first event will be a DID event.

    • ShortName: "YOUR_OWN_NAME"
    • DcmDspRoeEventId: 0
    • DcmDspRoeInitialEventStatus: DCM_ROE_CLEARED

    then expand out DcmDspRoeEvent > DcmDspRoeEventProperties > DcmDspRoeOnChangeOfDataIdentifier. In the DcmDspRoeOnChangeOfDataIdentifier select your DID.

  8. Next we want to create our DTC event. Expand out DcmDspRoe, right-click on DcmDspRoeEvents and select "Create DcmDspRoeEvent". The second event will be a DTC event.

    • ShortName: "YOUR_OWN_NAME"
    • DcmDspRoeEventId: 1
    • DcmDspRoeInitialEventStatus: DCM_ROE_CLEARED

    then expand out DcmDspRoeEvent > DcmDspRoeEventProperties > DcmDspRoeOnDTCStatusChange. Only the container needs to be configured by entering a ShortName.

  9. Now that we have defined a DID and our DTC events, we must finish the configuration by setting up our allowed Window Times. Window times will vary based on requirements, but for this tutorial we will only add a single window time. Navigate to DcmDspRoe > DcmDspRoeEventWindowTimes and right-click "DcmDspRoeEventWindowsTime" and create a new window time. Our configuration looks like this:

Dem Configuration

  1. We have now completed our DCM configuration for ResponseOnEvent. Because we have enabled the OnChangeOfDTC service of ResponseOnEvent we must also tell the Diagnostic Event Manager to forward DTC status change events to DCM. This is done with the DEM module configuration.

    Navigate to Dem > DemGeneral > DemTriggerDcmReports and set the configuration value to TRUE

  2. That completes our ResponseOnEvent configuration in DCM and DEM. The next step is to generate the BSW, include the newly generated SWCDin our RTE project and generate the RTE. This step will not be covered in this tutorial.

    NOTE: In order to trigger the DID event, the user must connect up their SWC to the configured Event port on the generated Dcm_Cfg_SWCD.arxml file. During each write change to that DID, the user must invoke the TriggerOnEvent operation for that specific EventID. This can be done through a SWC.

RTA-BSW Code Modification

  1. Finally, there seems to be a small bug in the RTA-BSW 3.1 generator which causes some header files not to be included in the generated Dcm_Lcfg_DspUds.c file. After the BSW generation is complete, navigate to /BSW/Gen/Dcm/Dcm_Lcfg_DspUds.c and add the following includes to this file:

    /*** Dcm_Lcfg_DspUds.c ***/ #include "SchM_Dcm.h" #include "DcmCore_DslDsd_Prot.h"


This provides the most basic steps necessary to configure the ResponseOnEvent service. Of course, the ResponseOnEvent service itself can vary depending on project requirements. This highlights one way that the service can be configured.

Besides the TriggerOnChange event that must be invoked from a SWC, there are no other required interaction between SWC and the DCM service for ResponseOnEvent. Some modes notifications are provided by DCM, but these are only optional configuration for a SWC.

Conclusion

The samples and advice provided with this AN are provided to inform and guide and should not be assumed to be universally applicable. It is your responsibility to interpret the content and apply it to your specific use case.