Configuring XCP
- Updated2026-04-22
- 8 minute(s) read
XCP is a session-based ASAM protocol for communication with control units. Using the protocol, individual memory areas of a control device can be read and written.
You can configure cyclic lists (DAQ or STIM) to facilitate the fast exchange of cyclic data between two participants. The cyclic lists are sent or received at a fixed interval from the control device.
Use the following workflow to configure XCP:
- Create an XCP group.
Refer to Creating Objects to add a new XCP group to the desired location in the database. When adding a new object, you can use the search bar to find the XCP group.
- Import an A2L file to use the configuration of certain variables that are not configurable in the group editor.
- Complete the following steps in any order:
- Modify the parameters in the XCP group editor.
- Optional: Attach a library to the XCP group.
Importing an A2L File
A2L files contain definitions and configuration data that are necessary to communicate with control devices. Some XCP properties cannot be configured in the XCP group editor. Import an A2L file to collect all required data.
-
In PAconfigurator, double-click the desired XCP group.
The XCP group appears in PAconfigurator (Classic).
-
Navigate to the XCP group in PAconfigurator
(Classic) and complete the following steps:
- Right-click the XCP group.
- Select .
An import dialog opens. -
Click the Open icon and select the
A2L file for import.
In ASAP2 file, the file name appears. The channels configured in the file load in the Channel Selection tab.
-
In the Channel Selection tab, you can
select the input variables and output variables to be read or written as
individual values.
If the file contains variable groups, select the group to be read or written.Tip Filter the channel selection list by clicking on a column header.
- Optional: To filter grouped data, enter the name of the desired group in Group filter.
- Optional: Enable the box at the top of the list to select all variables for import.
- Optional: Click Invert imported values to deselect the variables currently selected and select the variables not currently selected.
- Optional:
Enable Enable filter to filter by
variable groups.
Select filter criteria from a list or enter criteria. An asterisk acts as a wildcard.
- Optional:
Enable Show database differences
to compare data in the A2L file with
data in the PAtools database.
When the comparison results in differences, the variable row is marked brown. The cell that contains the difference is marked red. Hover over the cell to view a tooltip with a description of the difference.
-
In Normname settings, configure the
import of new variables.
Variables that did not exist in the database before import are created as names.
- Assign attributes to the names to easily identify the new variables.
- Select from existing attributes. The selection you make applies to all variables that are created as names upon import.
- Attributes are only valid for names created during import. Attributes are not available for names that exist in the database.
-
In the XCP Configuration tab, configure
the following layers:
- Events—If input variables are read with a fast DAQ list mechanism, assign channels to tasks. Assign channels to the tasks that the control device predefines. In the Events layer, use the arrows to add or remove channels to a task. Manually create events using New only if event data is missing in the A2L file.
- Protocol—View the protocol values defined in the A2L file. Adjust the values if necessary.
- Transport—The top-level transport layer contains all transport layers in the A2L file. If the file includes CAN-FD, you can adjust the baud rate for the data phase of all transport layers. The nested transport layers contain the modifiable parameters for specific transport layers.
-
In the Database tab, configure the
following settings:
- Update—Define how existing data is managed if you import the A2L file again.
- Initial value—Define a preset value for all variables. Initial value imports to the Value column in PAconfigurator (Classic).
- Digits—Define the number of decimal places that display in PAconfigurator (Classic). Digits imports to the Fractional Part column in PAconfigurator (Classic).
- Write original names of imported variables to comment column—Choose whether the original name of the variable in the A2L file displays in the Description column. PAtools transforms special characters into valid characters during import. Enable this option if the original variable names included special characters.
- Database—View the variables in the XCP group that are not in the selected A2L file.
-
Click the import icon.
The file imports data to the XCP group in PAconfigurator (Classic).
An error message might display under the following conditions:
- The XCP group in PAconfigurator (Classic) contained data before import started. Click the red X icon to overwrite the existing data with data from the file.
- The A2L file contains errors. Fix the errors in the file and import the file again.
Configuring the XCP Group
Configure parameters for the XCP group in PAconfigurator (Classic).
-
In PAconfigurator, double-click the XCP group from the list of
objects where you added the group.
The XCP group appears in PAconfigurator (Classic).
- Enter a unique name for the XCP group.
- In the Device column, validate the name of the imported XCP file.
- Optional: In the Bus Status column, enter the bus status that is written into the variable at runtime.
-
In the Port Number
column, select the CAN port for the communication between
the master and the slave.
You can use a variable to define the port number dynamically at test runtime.
- In the Name column, validate the name of the imported XCP variable.
- Validate the Value of the imported XCP variable.
- Optional:
Modify the physical Units
of the variable.
The units of the XCP variable are set in the imported file.
- Optional:
Modify the Data Type of
the XCP variable.
The data type of the XCP variable is set in the imported file.
- Optional:
In the Fractional Part
column, modify the number of decimal places that display in
PAcontroller.
The decimal places for the XCP variable are set in the imported file.
If you enter 0, no decimal places display in PAcontroller. If the measurement is performed with higher precision, the exceeding digits are rounded. Figures greater than or equal to five are rounded up.
- In the Fixed Formula column, validate the formula imported from A2L file.
-
Validate the Channel Type
of the input/output variable that was imported from the
A2L file.
Option Description XCP_SINGLE_IN Channel type for input variables that are updated infrequently.
With each call of the channel update, an upload is triggered to the control device. The control device sends a corresponding answer.
The call is synchronous.
Therefore, the channel update finishes after reading the new value of the channel variable from the response of the control device.
XCP_SINGLE_OUT Channel type for output variables that are updated once or infrequently.
For example, select XCP_SINGLE_OUT for configuration variables that are set only once after the start of a session.
The update is synchronous.
XCP_CYCLIC_IN Channel type for input variables that are read by the control unit in intervals.
The control device defines the update interval of the input variables. The control device is influenced by assigning the individual channel to a corresponding (XCP) EVENT.
The (XCP) EVENT presets the update interval.
The frequency group only presets the interval for synchronizing the channel variables with the XCP stack.
XCP_CYCLIC_OUT Channel type for an XCP cyclic output value. XCP_MAP_IN Channel type for reading value fields. The value fields can have a different number of dimensions. During implementation in PAtools, a value field is read into a value table through the XCP_MAP_IN channel type.
The value table can be one-, two-, or three-dimensional. The value table adapts to the correct dimensions during the reading process.
The channel variable you assign in the Name column provides feedback about the progress of the operation.
- -1: An error occurred during the transfer of the value table.
- >0: As soon as the value table is transferred, the assigned channel size contains the number of cells to be transferred. With each cell transferred, the value is decremented by 1. If the value of the variable drops to 0, the transmission is complete.
- 0: During the next cycle, the value table is read again. To prevent a continuous reading of the value table, condition updates to these channels in the operation channel.
XCP_MAP_OUT Channel type for writing a value table to a value block.
If the channel variable in the Name column is 1, the transmission process starts with the following steps.
- The dimensions of the value table and the number of cells are determined. The value is written to the status variable.
- The channel update starts.
- The status variable decrements by 1 with each transferred cell.
- If all cells are successfully transferred, the value of the status variable is 0.
- The value of the corresponding channel variable is 0.
A new transmission of the value table starts when the following are true.- The channel variable is 0.
- A positive edge change occurs after 1.
XCP_CONTROL Channel type for controlling the behavior of the XCP stack.
The following values are possible:
- 0 - Init: No open sessions are available to control the device. No communication with the control device occurs.
- 1 - Connect: No connections are available to control the device.
- 2 - Use the GetSeed authentication procedure to make the blocked resources of the control device accessible. The procedure depends on the corresponding control device to determine the resources that are protected.
- 3 - Configured: Start the configuration if you configured cyclic lists.
- 4 - Sleep: Interrupt sending cyclic data for a short time without discarding the configuration. Use the sleep function to reduce the load of the control device.
- 5 - Running: The control device sends the configured cyclic lists. The runtime system processes the cyclic lists.
XCP_STATUS Channel type for the XCP status. XCP_MODIFY_BITS Channel type for XCP outputs with bitmask. -
In the Operation Group
column, select an operation group for the acquisition of the
variables in PAtools.
Define the operation group in an operation table.
- Optional: In the Description column, enter a description of the XCP variable.
- Click Save.
Seed and Key for XCP
Seed and key (seed-key) is a security mechanism that is provided by the XCP specification.
The XCP slave requests a key from the XCP master before granting access to the specification. Then, the XCP master requests a seed from the XCP slave to compute the key. The algorithm that the master uses to compute the key is confidential. The algorithm is encapsulated in a library. During implementation, compile the library into a shared object.
Creating a Shared Object for the Seed-Key Algorithm
An extension to the XCP editor allows you to create a shared object for the seed-key algorithm. The algorithm in the shared object runs on an Intel CPU.
Introduced in PAtools 2025 Q3
To create a shared object for XCP, complete the following steps:
-
Locate the following source files in the /home/patools/xcp folder
on the PXI controller:
- SeedNKeyXcp.h
- SeedNKeyXcp.c
- Makefile
-
In the SeedNKeyXcp.c file,
fill the XCP_ComputeKeyFromSeed(…) function with
your algorithm.
If you have unique algorithms for different access privileges, use different functions for each access privilege.
The following are example functions that are determined by an access privilege.
- computeKeyFromSeedCalPag(…): calibration access and paging access.
- computeKeyFromSeedDaq(…): acquisition access.
- computeKeyFromSeedStim(…): stimulation access.
- computeKeyFromPgm(…): programming access.
- computeKeyFromSeedDbg(…): debugging access.
-
Execute Makefile.
A shared object named SeedNKeyXcp.so is generated.
The library (shared object) is included in the test package after you assign the library to an XCP group. You can assign different libraries to different XCP groups.
Attaching Seed-Key Libraries to an XCP Group
In PAconfigurator, attach the seed-key security mechanism to the XCP group you created.
Introduced in PAtools 2026 Q2
- Navigate to the desired XCP group.
-
Right-click the XCP group and select Assign Seed Key
Libraries.
The Assign Seed Key Libraries dialog loads.
-
In the Seed Key Libraries menu, complete
one of the following steps:
- Select + Upload Library and configure the library if one does not exist in the database.
- Select the library for the device.
- Click Save.