User Manual SOMEIP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

SOME/IP with CANoe Communication Setup

Part 1. Introduction

V1.0 | 2023-07-18
Agenda

u Overview
Communication Setup
Technical References
Summary

2
Overview
2 perspectives on SOME/IP communication

u Let's assume that 2 ECUs communicate via SOME/IP.

Switch
ECU 1 ECU 2
SOME/IP Data

Signal Oriented Service Oriented


Database -> Communication Matrix Database -> Service Description
• Tx Node List
ECU 1 Service
• ECU1
Provider
• Rx Node List Service Interface
• ECU2
• PDUs
• Signals

ECU 2
Service
Signals PDU (Static Layout) PDU (Dynamic Layout) Consumer

AUTOSAR Sender/Receiver AUTOSAR Focus


Focus Client/Server
Classic Communication Adaptive SOME/IP
Network Communication
Application

3
Overview
SOME/IP Support in CANoe

Simulation Setup Communication Setup

CANoe

Communication Signal Oriented Communication Service Oriented Communication


Database ARXML(AUTOSAR Classic) ARXML(AUTOSAR Adaptive), vCDL
Configuration AUTOSAR PDU, Node, Network Service, Participant, Binding
Feature Focus Protocol Application
Data types Simple (layout predefined) Complex (runtime serialization)
Abstraction Low (signal / PDU) Higher (service interface)
Use Case Rest Bus Simulation, Low-level Fault Test Rest Bus Simulation, Application Test

4
Overview
SOME/IP in Communication Setup

Calculator
Consumer
u Service Communication Object is defined by
u Service interface type interface Calculator {
> Method method float Add(int, int);
> Event
method float Substract(int, int);
> Field
method float Multiply(int, int);
u End points method float Divide(int, int);
> Provider / Consumer
field int32 CalcResult {get;set;notify;}
> Switched to simulated or real
event struct State {
int AddCount;
int SubstractCount;
int MultiplyCount;
int DivideCount;
}
} Calculator
Provider
Any pair of endpoints may:
… connect distinct physical devices, or
… share a MAC address on the same PHY, or
… share an IP address, or
… connect abstract simulation code.

5
Overview
SOME/IP in Communication Setup

u Used to configure transmission between the endpoints of a Communication Object


u Determine which protocol and network must be used for transmission
u Abstract Binding
u Enables transmission between simulated endpoints within CANoe
u Well suited for Virtual prototyping
u Communication Object is directly linked with Abstract Binding

6
Overview
SOME/IP in Communication Setup

u SOME/IP Binding
u Enables transmission between endpoints base on SOME/IP via TCP/UDP/IP and Ethernet
u Supports SOME/IP, SOME/IP Service Discovery protocol
u Communication Object can be linked with SOME/IP Binding through Abstract Binding

7
Overview
SOME/IP in Communication Setup

u SOME/IP Binding Service ID: 1666 Method ID: 1,2,3,4


Calculator
u Service Interface Mapping required Consumer
> Service ID
> Method ID interface Calculator {
> Event ID IP address: 192.168.1.2
method float Add(int, int);
> Event Group TCP port: 50000
method float Substract(int, int);
u SOME/IP Endpoint Mapping required UDP port: 40000
method float Multiply(int, int);
> IP Address
> UDP/TCP Port Number method float Divide(int, int);
> Provider Instance ID field int32 CalcResult {get;set;notify;}
event struct State {
int AddCount;
int SubstractCount;
int MultiplyCount;
int DivideCount; Calculator
} Provider
}

Event ID: 8001 IP address: 192.168.1.1


Field Getter ID: 5
Event group ID: 1
Field Setter ID: 6 TCP port: 50000
UDP port: 40000
Instance ID: 1

8
Overview
Terms in CANoe

Simulation Setup Communication Setup Description


Database Data Source The data in the data source is not automatically used by CAN
oe. To enable the use of participants/endpoints in CANoe (e.
g. for simulation, analysis, display in the Symbol Explorer), y
ou must first configure them in the Communication Setup (in
tegrate into CANoe).

- Data Source - vCDL The acronym vCDL stands for Vector Communication Descrip
tion Language and is a domain-specific language (DSLClosed
) for the description of communication objects in CANoe.

ECU/Node Participants Participants/distributed objects can be used to group commu


nication endpoints that are logically associated; e.g. because
they belong to the same ECU, or because they are implemen
ted by the same software component. Thus the participants c
oncept allows a more flexible modeling.

Frame/PDU/Signal Communication Object – Service Communication objects abstract communication of different l


evels and are not bus-specific. However, frames on the respe
ctive bus system can still be analyzed.

Interaction layer Binding The binding replaces the interaction layer concept. It links ab
stract communication objects and distributed objects to conc
rete bus systems and protocols.

Simulation Node Application Model Application Logic is implemented as a Application Model via
CAPL programming

9
Agenda

Overview
u Communication Setup
Technical References
Summary

10
Communication Setup
Overview

u The Communication Setup is the central starting point for communication configuration.
u the application layer (application models)
u the communication layer (communication, bindings)
u the transmission medium (hardware, bindings)

11
Communication Setup
Window Layout

u System View
u Application Layer Objects : Display ‘Namespaces – Participants – Services’
u Application Models : Programming ‘CAPL’ or ‘C#’
u Data Sources : ‘vCDL’ which includes SOME/IP configuration

12
Communication Setup
Workflow Example

u Considered application scenario Calculator


Consumer
u Service interface: Calculator interface Calculator {
u Service Provider: Provider
method float Add(int, int);
u Service Consumer: Consumer
method float Substract(int, int);
method float Multiply(int, int);
u Input File method float Divide(int, int);
u Data Source: SomeIP.vcdl field int32 CalcResult {get;set;notify;}
> Definition of interface: Calculator event struct State {
> SOME/IP communication parameters int AddCount;
> Bindings int SubstractCount;
int MultiplyCount;
u Application Model: provider.can, consumer.can int DivideCount;
> Service logics : Four arithmetic }
Calculator
}
> Notify Event(State) and Field(Result Value) Provider

u Following workflows are shown next


u Workflow 1 – Pure simulation
> Both Provider and Consumer are simulated in CANoe
u Workflow 2 – Partial Simulation with a real target
> Either Provider or Consumer is simulated in CANoe Download Input Files Download Solution
13
Communication Setup
Workflow 1 - Preparation

Step 0
Prepare Sample vCDL, CAPL Step 1
files -> Download
Start by creating a new
Ethernet configuration

Step 2
Switch to tab Simulation

Step 3
Open dialog by clicking
Communication Setup

14
Communication Setup
Workflow 1 – Import Data Source

Step 4
Click Data Sources to
open the import view

Step 5
Click „Load Data Source” Button
and select vCDL file

15
Communication Setup
Workflow 1 – Check Import Result

Step 7 (optional)
Step 6
Imported services
A successful import is
and data types can
indicated by the green
be modified via this
button
Button

Step 9
Switch Participant to
Simulated(CANoe) or
Real(Device) Mode

Step 8
The imported
elements are shown
in a Details

16
Communication Setup
Workflow 1 – Configure Application Models

Step 10
Assign the application
models(CAPL, C#)

Step 11
Edit the application
models(CAPL, C#)

17
Communication Setup
Workflow 1 – Implement Application Models

consumer.can provider.can

// Call method 'Add' of service 'Calculator' when key 'c' is pressed on start
on key 'c' {
{ // Set timer to cyclic interval of 1000 milliseconds
CommunicationObjects::Calculator[Consumer,Provider].Add.CallAsync(3,6); setTimerCyclic(stateEventTimer, 1000);
} }

// This handler is called when the return value of method 'Add' of service 'Calculator' is on timer stateEventTimer
received
{
on fct_returned CommunicationObjects::Calculator[Consumer,Provider].Add
// Update state event. This will also trigger the transmission of the event
{
$CommunicationObjects::Calculator[Provider].State.AddCount = gAddCount;
// Print result in the Write Window of CANoe
$CommunicationObjects::Calculator[Provider].State.SubtractCount = gSubtractCount;
write("Result of Add method: %f", this.result);
$CommunicationObjects::Calculator[Provider].State.MultiplyCount = gMultiplyCount;
}
$CommunicationObjects::Calculator[Provider].State.DivideCount = gDivideCount;
}

// Implementation for method 'Add'


on fct_called CommunicationObjects::Calculator[Provider].Add
{
this.result = this.operand1 + this.operand2; // Calculate result
gAddCount++; // Update counter

Step 12 this.ReturnCall(); // Return result

Implement the following application // Update CalcResult Field. This will also trigger the transmission of the field notification

models for Provider and Consumer $CommunicationObjects::Calculator.providerSide[Provider].CalcResult = this.result;


}

18
Communication Setup
Workflow 1 – Implement Application Models

Step 13
Step 14
Start measurement
Switch to
Communication
Object column
view

Step 15
Press key „c“
You can observe the method call
from Consumer in the trace
window

19
Communication Setup
Workflow 2 – Partial Simulation with a Real Target

u If either endpoint Provider or Consumer operates on Real Target:


u Change step 9: Switch Participant corresponding to Real Target to ‘Real (Device)’ and ‘Publish’

u Change step 11: Deactivate or remove the corresponding application model

20
Agenda

Overview
Communication Setup
u Technical References
Summary

21
Technical References
Video Recording

u Introduction to Automotive Ethernet


u https://www.vector.com/kr/ko/events/global-de-en/webinar-recordings/2023/introduction-to-
automotive-ethernet/

u CANoe for Service-Oriented Architectures(SOA) - Part1. SOA Fundamental


u https://youtu.be/M_SXOgci1p4

22
Technical References
Calculator Example

u CANoe configuration, vCDL, Analysis Features, Simulation Features, CAPL Codes


u Download Sample Configuration : https://portal.vector.com/shared/068f1303-77de-4eab-8bd0-
ca37938c6885

23
Technical References
CANoe Help Manual

u CANoe Communication Concept Overview

24
Agenda

Overview
Communication Setup
Technical References
u Summary

25
Summary
This document is for …

u Beginners in SOME/IP with Communication Setup

u Help to understand for the Initial Setup


u SOME/IP concept in CANoe
u Import Data Sources
u Import Application Models
u Write Data Source as a vCDL
u Simulation with CANoe GUI features
will be covered in other Parts…
u Analysis of SOME/IP data
u Simulation with CAPL programming

u Quick start guide for work of basic SOME/IP simulation, analysis


u You can extend your knowledge and know-how through CANoe Help Manual!
u It covers More detailed technical information.

26
For more information about Vector
and our products please visit

www.vector.com

Author:
Lee, Jaecheol
Vector Korea

27 © 2023. Vector Korea IT Inc. All rights reserved. Any distribution or copying is subject to prior written approval by Vector. V1.0 | 2023-07-18

You might also like