Professional Documents
Culture Documents
SN-InD-1-044 Example How To Use XCP in VTESTstudio
SN-InD-1-044 Example How To Use XCP in VTESTstudio
2020-01-17
Support Note SN-IND-1-044
Table of Contents
1 Overview .....................................................................................................................................2
2 Preconfiguration of an XCP device in CANoe ...............................................................................3
2.1 Creating an XCP device using an A2L file.............................................................................3
2.2 Check the communication parameters and change or add them manually if neccassary .......4
2.3 Activate the XCP parameters for measurement and calibration.............................................5
3 Configuration of vTESTstudio ......................................................................................................7
3.1 Import of the CANoe settings into vTESTstudio ....................................................................7
3.2 Creation of a Test Unit .........................................................................................................8
3.2.1 Handling of XCP variables ..........................................................................................8
3.2.2 Handling of specific XCP commands via a CAPL file ..................................................9
3.3 Building of the Test Unit .......................................................................................................9
4 Unit Testing in CANoe ............................................................................................................... 11
4.1 Importing of the Test Unit “Hello World” from vTESTstudio into CANoe............................... 11
4.2 Executing the test configuration and Test Unit “Hello World” ............................................... 11
5 Conclusion ................................................................................................................................ 12
6 Contacts .................................................................................................................................... 12
Example How to Use XCP in vTESTstudio
1 Overview
CANoe is Vector’s analysis and simulation tool for bus systems used in the
automotive industry. There are options available for bus systems like CAN & CAN FD, LIN, MOST,
FlexRay and Ethernet, but also for application layer protocols like XCP.
CANoe is the right tool to analyze, observe, simulate data traffic and allows creating a whole functional
model of the network system. This model can be used in the entire development process of the
network from planning to final testing.
vTESTstudio is a powerful development environment for creating automated ECU tests. In order to
increase the efficiency in terms of test design and to simplify the reusability it provides
• programming-based,
• table-based and
• graphical test notations and test development methods.
vTESTstudio can be employed in all product development phases: from model testing right through to
system validation. Thanks to the use of open interfaces vTESTstudio can be simply incorporated into
existing tool landscapes.
This Support Note describes how to setup an example XCP project in vTESTstudio. Therefore a
preconfigured XCP project in CANoe will be used to export needed data into vTESTstudio.
This data can be used, modified and can be reimported into CANoe as compiled vTESTstudio Test
Unit.
Basic knowledge how to use CANoe and vTESTstudio is required. For that you can use for instance
the KnowledgeBase article Creating a Project in vTESTstudio – Step by Step:
Caution
The used versions of CANoe and vTESTstudio must be compatible to each other. See
Required CANoe Version
You can use the existing vTESTstudio project XCP Tester CAN in the CANoe Sample Configurations
as a template for XCP configurations (only CANoe version ≥ 12.0).
For general questions about migrating older projects, please refer to the Migration Manual. You will
find the general procedure and further hints in the manual located within your installation directory,
e.g.: C:\Program Files\Vector vTESTstudio
3.0\Doc\vTESTstudio_MigrationManual_EN.pdf.
Now you can add your A2L file and create an XCP device:
2.2 Check the communication parameters and change or add them manually if
neccassary
Depending on the transport layer you can see and change the different communication parameters by
selecting the XCP device:
If you have a working CANape project, you can also import the settings from the CANape project file
the CANape.ini by using the menu command Import Device Settings from CANape:
You can define different measurement groups where you can activate the parameters you need. For
each activated parameter, a corresponding CANoe system variable is generated which can be used
as usual. To calibrate a calibration parameter, you assign a value to the corresponding system
variable. To measure a parameteryou have to activate it and select a measurement mode such as
Polling or DAQ mode. You also need to select the Auto Read option.
You will import these configured parameters and use them in vTESTstudio afterwards.
For preparation of the Test Unit please add a Test Setup for Test Units and a Test Configuration
window by following steps 1 to 3. The test configuration itself (here Test Configuration 1) will be
compiled with vTESTstudio and imported into CANoe later on.
3 Configuration of vTESTstudio
3.1 Import of the CANoe settings into vTESTstudio
Please open vTESTstudio and create a new project by going to the backstage area and New Project:
Then simply import all settings from the CANoe configuration (*.cfg) by following steps 1, 2 and 3:
Now it is possible to use all values from the bus specific database:
Furthermore all system variables and in this way all XCP parameters preconfigured in CANoe are
ready to be used in vTESTstudio.
After you have imported all nessescary data from CANoe create a New Test Unit and name it, f.e.
Hello World:
For your XCP project this chapter will give you some hints how to set it up.
Important
XCP values are represented as system variables in vTESTstudio like in CANoe!
So this means you can read or write them via a CAPL command like this:
• Assigning values:
@<sys> = 1;
@sysvar::<sys> = 1; is also possible
• Reading values:
if (@<sys>==2.0)
• Special system variables, arrays:
SysSetVariable<type>(<sys>, buffer[]);
SysGetVariable<type>(<sys>,buffer[], size);
Of course XCP system variables can be read/set also by vTESTstudio internal functionality, f.e. Set,
Check or State Change commands:
If you are planning to include CAPL test files into the vTESTstudio environment please mark the test
cases with the export keyword as interface functions which can then be called in other Editors like
the test table. For the Connect/Disconnect of the tested ECU and extended XCP functionality the
same CAPL commands like in CANoe can be used.
Important
If you have finished your project in vTESTstudio you are ready to build the Test Unit. Therefore go to
the Home ribbon and click Build Test Unit.
Copyright © 2020 – Vector Informatik GmbH 9
Contact Information: www.vector.com or +49-711-80 670-0
Example How to Use XCP in vTESTstudio
After the compile process the result output in vTESTstudio should look like this:
Now you are ready to import the compiled Test Unit into CANoe. Please do that by following steps 1
and 2:
The result in the Test Configuration window should look like this:
4.2 Executing the test configuration and Test Unit “Hello World”
You are now finished with importing the Test Unit. In the next steps you can start the measurement
and execute the test configuration.
Make sure you have started the measurement with or press key <F9>.
Then it is possible to execute the Test Unit:
5 Conclusion
You have learned how to preconfigure CANoe in such way that a simple configuration in vTESTstudio
is possible with the import of CANoe settings.
This means for example that variables from the bus database or system variables are available in
vTESTstudio. Because XCP parameters are represented as system variables in CANoe, they are
ready to use as well in vTESTstudio.
After that your project work has to be done. Some hints how to handle XCP parameters and how to
use specific XCP commands have been described.
The compiling process itself is trivial with a click on the Build test case button.
As a last step the compiled Test Unit can be imported into CANoe and is ready to execute while the
measurement is running.
6 Contacts
For support related questions please address to the support contact for your country
https://www.vector.com/int/en/company/contacts/support-contact/.