Acquire selected measurements from configured slave connection
Simulink Real-Time / XCP / CAN
Vehicle Network Toolbox / XCP Communication / CAN
The XCP CAN Data Acquisition block acquires data from the configured slave connection based on measurements that you select. The block uses the XCP CAN transport layer to obtain raw data for the selected measurements at the specified simulation time step. Configure your XCP connection and use the XCP CAN Data Acquisition block to select your event and measurements for the configured slave connection. The block displays the selected measurements as output ports.
The XCP communication blocks support the use of Simulink® accelerator mode and rapid accelerator mode. You can speed up the execution of Simulink models by using these modes. For more information on these simulation modes, see Design Your Model for Effective Acceleration (Simulink).
The XCP communication blocks support code generation with limited deployment capabilities. Code generation requires a C++ compiler that is compatible with the code generation target. For more information, see Supported and Compatible Compilers.
Config name— Specify XCP CAN session name
Select the name of the XCP configuration that you want to use. This list displays all available names specified in the XCP CAN Configuration blocks in the model. Selecting a configuration displays events and measurements available in the A2L file of this configuration.
You can acquire measurements for only one event by using an XCP CAN Data Acquisition block. Use one block for each event whose measurements you want to acquire.
Event name— Select an event
Select an event from the available list of events. The XCP CAN Configuration block uses the specified A2L file to populate the events list.
All Measurements— List all measurements available for event
This list displays all measurements available for the selected event. Select the measurement that you want to use and click the add button, to add it to the selected measurements. On your keyboard, press the Ctrl key to select multiple measurements.
In the Block Parameters dialog box, type the name of the measurement you want to use in the Search box. The All Measurements list displays a list of all matching names. Click the x to clear your search.
Selected Measurements— List selected measurements
This list displays selected measurements. To remove a measurement from this list, select the measurement and click the remove button, .
In the Block Parameters dialog box, use the toggle buttons to reorder the selected measurements.
Force Datatypes and Allow Non-Scalar— Set the port data type according to the type definition in the A2L file
This parameter enables support for XCP data types and dimensions as defined in
the ASAP2 standard. When the parameter value is set to
Sets the port data type according to the type definition in the A2L file
Supports up to three-dimensional XCP measurements in Simulink
These ASAP2 data types are supported by corresponding Simulink port data types:
The dimension support in the block accommodates the different treatment of
matrices by MATLAB® and the ECU. The MATLAB default operation treats matrices as
row-major matrices. An XCP measurement can have a
ROW_DIR . If a matrix
COLUMN_DIR, the blocks rearrange the measurement
in memory and ensure that the matrix (row X, col Y) in MATLAB refers to the same
entry as (row X, col Y) on the ECU. The rearrangement causes matrix entries that
are contiguous on the ECU to be noncontiguous in MATLAB and Simulink.
DAQ List Priority— Specify a priority value for slave device driver
Specify a priority value as an integer from 0 to 255 for the slave device
driver to prioritize transmission of data packets. The slave can accumulate XCP
packets for lower priority DAQ lists before transmission to the master. A value of
255 has the highest priority. The
communicates the DAQ List Priority value from
master to slave. This communication method differs from the specification of the
Event Channel Priority property, which comes from the A2L file.
Sample time— Specify sampling time of block
Specify the sampling time of the block during simulation, which is the simulation time. This value defines the frequency at which the XCP CAN Data Acquisition block runs during simulation. If the block is inside a triggered subsystem or is to inherit sample time, you can specify –1 as your sample time. You can also specify a MATLAB variable for sample time. The default value is 0.01 (in seconds).
Enable Timestamp— Enable reading timestamp from incoming DTO packets
When the Timestamp is enabled, the block reads the timestamp from incoming DTO packets and outputs the timestamp to Simulink. The Enable Timestamp check box appears in the block parameters dialog box when the parameter is supported in the A2L file.