MATLAB Answers

Error in XCP communications in Simulink: "Dot indexing is not supported for variables of this type"

7 views (last 30 days)
I was testing to see if I can use Matlab/Simulink to communicate with a XCP control (which I happen to have th A2L file), but I get the following error everytime I try to use the A2L file in a Data Acquisition block:
"Dot indexing is not supported for variables of this type"
see below:
Do you know the reason why? And how can I make it work? I am attaching the A2L file just in case, just change the extension from txt to a2l.

Accepted Answer

Siying Liu
Siying Liu on 16 Jul 2021
Edited: Walter Roberson on 16 Jul 2021
If you run the following code to read the A2l-file in the MATLAB command window before R2021b:
>> a2lObj = xcpA2L('AuxRTCDC_10P_14T_3ST_2S_003_244.a2l')
you will notice the a2lObj has empty properties ProtocolLayerInfo and TransportLayerCANInfo, which are required when using the XCP CAN Configuration block. Please refer to the A2L File Management documentation page for more information. (The block has additional code to check if these properties are empty to ensure the XCP channel has the necessary information to establish the connection later on, whereas the MATLAB xcpA2L function only parses the A2L-file and it does not have this sanity check to make sure these properties are nonempty.)
These properties are empty because, in this specific file "AuxRTCDC_10P_14T_3ST_2S_003_244.a2l", the ProtocolLayer and TransportLayerCAN information is defined under the "IF_DATA XCPplus" sections, which cannot be parsed properly by the xcpA2L function before R2021b. This is a known limitation.
Starting R2021b ( ), parsing the "IF_DATA XCPplus" section is supported, but it only accepts A2L-files that contain a single "XCP_ON_xxx" section per one type of transport layer. For example, if your A2L-file only defines one "XCP_ON_CAN" section and one "XCP_ON_TCP_IP" section, then the file will be read properly. But if your A2L-file, like this A2L-file, defines 3 "XCP_ON_CAN" sections, then you'll see the following error message when running xcpA2L:
Multiple CAN transport layers are defined.
Once R2021b is released, one solution is to manually delete the duplicated "XCP_ON_CAN" sections in your A2L-file and leave only one section which will be used to connect to the XCP Server.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!