SOME/IP with CANoe Communication Setup

Part 4. Simulation with CAPL Programming

Version 1.0, July 18, 2023

Agenda

Overview

This document is for users who want to:

The CANoe sample configuration is prepared for your understanding. You can access it at: https://portal.vector.com/shared/068f1303-77de-4eab-8bd0-ca37938c6885

This serves as a quick start guide for basic SOME/IP simulation and analysis. For extended knowledge, refer to the CANoe Help Manual, which covers more detailed technical information.

Application Model (CAPL)

Basic CAPL Applications

Value Access

Use the '$' sign for accessing communication values.

'Write Value'

This can trigger Event and Field Notification:

$CommunicationObjects::Calculator.providerSide[Provider].State.AddCount = gAddCount;
$CommunicationObjects::Calculator.providerSide[Provider].State.SubtractCount = gMultiplyCount;
$CommunicationObjects::Calculator.providerSide[Provider].State.MultiplyCount = gMultiplyCount;
$CommunicationObjects::Calculator.providerSide[Provider].State.DivideCount = gDivideCount;
'Read Value'
write("State event received. AddCount: %d, SubtractCount: %d, MultiplyCount: %d, DivideCount: %d",
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.AddCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.SubtractCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.MultiplyCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.DivideCount);
Request Call

Use the CallAsync(params..) function for calling Method and Field Getter/Setter.

'Method Call'

Example: Call method 'Add' of service 'Calculator' when key 'c' is pressed:

// Call method 'Add' of service 'Calculator' when key 'c' is pressed
CommunicationObjects::Calculator.Add.CallAsync(3,6);
'Field Getter/Setter'

Example: Call Field Getter 'CalcResult' of service 'Calculator' when key 'g' is pressed:

// Call Field Getter 'CalcResult' of service 'Calculator' when key 'g' is pressed
CommunicationObjects::Calculator.CalcResult.Get.CallAsync();

Example: Set CalcResult to '0' when key 's' is pressed:

// Call Field Setter 'CalcResult' of service 'Calculator' when key 's' is pressed
CommunicationObjects::Calculator.CalcResult.Set.CallAsync(0);

The number and data type of input parameters follow the prototype defined by the Data Source (vCDL).

Event Handler

on fct_called / on fct_returned are called when Method and Field Getter/Setter are processed.

Provider side - on fct_called

Called when receiving the request from a consumer:

// Implementation for method 'Add'
on fct_called CommunicationObjects::Calculator.Add
{
 this.result = this.operand1 + this.operand2; // Calculate result
 gAddCount++; // Update counter
 this.ReturnCall(); // Return result
}
Consumer side - on fct_returned

Called when receiving the response from a provider:

// This handler is called when the return value of method 'Add' of service 'Calculator' is received
on fct_returned CommunicationObjects::Calculator.Add
{
 // Print result in the Write Window of CANoe
 write("Result of Add method: %f", this.result);
}
on value_change

Called when the value of an Event / Field Notification changes.

Example: Handler for the 'State' event:

// This handler is called when the value of the event 'State' changed
on value_change CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State
{
 write("State event received. AddCount: %d, SubtractCount: %d, MultiplyCount: %d, DivideCount: %d",
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.AddCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.SubtractCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.MultiplyCount,
$CommunicationObjects::Calculator.consumerSide[Consumer, Provider].State.DivideCount);
}
on value_update

Called when the value of an Event / Field Notification is updated.

CAPL Practice

Application Logics Example

The following diagram illustrates the interaction between a consumer and a provider using CANoe:

Consumer.can:

Provider.can:

The communication is established via SOME/IP over Ethernet, with a binding block configured.

Scenario 'Method Call'

Consumer.can:

  1. Call Method 'Add' with parameters 3 and 6.

Provider.can:

  1. Implementation for method 'Add': Calculates the sum of operands, increments a counter, and returns the result.

Consumer.can:

  1. On Method Returned 'Add': Receives the result and prints it to the CANoe Write Window.

This process involves dragging and dropping elements from the Symbols Window.

Scenario 'Event' Trigger

Provider.can:

  1. Trigger Event 'State': Updates the state variables (AddCount, SubtractCount, MultiplyCount, DivideCount) and triggers a notification.

Consumer.can:

  1. On Value Change Event 'State': Receives the updated state values and prints them to the CANoe Write Window.

This scenario also utilizes drag and drop functionality from the Symbols Window.

Scenario 'Field Notification' and 'Field Getter and Setter'

Consumer.can:

Provider.can:

This involves drag and drop operations from the Symbols Window.

Technical References

Video Recording

Introduction to Automotive Ethernet

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

Topics covered:

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

Link: https://youtu.be/M_SXOgci1p4

This video covers Service-Orientation in E/E Designs.

Calculator Example

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

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

The CANoe interface displays various configurations including communication setup, simulation panels, trace windows, and event/field data. It shows the interaction between consumer and provider for methods like 'Add' and events like 'State', as well as field updates for 'CalcResult'. The trace window logs SOME/IP messages and Service Discovery information.

CANoe Help Manual

CANoe Communication Concept Overview

CANoe provides a uniform and cross-network communication concept for simulation and testing, enabling application-related modeling of communication patterns. It decouples logical communication from network protocols, offering a network-independent interface for application models and test scripts.

Concept:

Application Layer Objects:

Configuration:

Binding:

Programming:

CAPL Programming Overview

This section details how to use objects and APIs in C# or CAPL for application modeling and testing. It covers:

PDF preview unavailable. Download the PDF instead.

User Manual SOMEIP with Communication Setup Part4 Microsoft PowerPoint for Microsoft 365

Related Documents

Preview CANoe .Ethernet: Automotive Ethernet Network Simulation and Analysis
Product information for Vector's CANoe .Ethernet option, detailing its capabilities for simulating, testing, and analyzing automotive Ethernet networks, including support for protocols like SOME/IP, DoIP, and hardware like the VN5600 series.
Preview Vector CANoe/CANalyzer 12.0 New Features Webinar
An overview of the new features and improvements in Vector's CANoe and CANalyzer software, version 12.0, presented in a webinar. Covers communication concepts, Ethernet, testing, VT System, new options, Car2x, and additional protocols.
Preview CANoe/CANalyzer New Features Version 14 | Vector
Explore the new features and enhancements in Vector's CANoe and CANalyzer Version 14, including updates to CANoe4SW, CANoe4Server, SOA, Ethernet, LIN, Car2x, and discontinued hardware support.
Preview CANoe 12.0 and CANalyzer 12.0 Feature Matrix
A comprehensive feature matrix detailing the capabilities of Vector's CANoe 12.0 and CANalyzer 12.0 automotive software tools, covering various bus systems, analysis functions, simulation capabilities, and system requirements.
Preview Vector CANoe Option DDS: Simulate and Test DDS Applications Efficiently
Vector expands its CANoe development and test environment with the new CANoe Option DDS, enabling users to simulate, analyze, and test DDS-based systems efficiently. Ideal for automotive, medical technology, and Industry 4.0 sectors.
Preview CANoe Product Information: Development, Testing, and Analysis Tool
Explore CANoe, a versatile tool for automotive network development, testing, and analysis. Learn about its functions, system requirements, and options for ECU development.
Preview CANoe 14 and CANalyzer 14 Feature Matrix
A comprehensive feature matrix comparing CANoe 14 and CANalyzer 14, detailing supported network systems, description formats, variants, and functionalities for automotive software development and testing.
Preview Vector CANalyzer: Comprehensive Automotive Network Analysis Tool
Vector CANalyzer is a powerful software tool for analyzing, stimulating, and diagnosing automotive networks such as CAN, LIN, FlexRay, and Ethernet. This document provides an overview of its features, functions, interfaces, and options, including detailed explanations of its analysis windows, programming capabilities with CAPL, diagnostic functions, and hardware compatibility. It is designed for automotive engineers and developers working with in-vehicle communication systems.