Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for ECUC ARXMLs #281

Closed
andraflandra opened this issue Feb 5, 2019 · 12 comments
Closed

Support for ECUC ARXMLs #281

andraflandra opened this issue Feb 5, 2019 · 12 comments
Assignees

Comments

@andraflandra
Copy link

Hi, I am using an internal .arxml file I cannot show you but also a public one available here:
https://raw.githubusercontent.com/nikidimitrow/Learning-AUTOSAR-fundamental/master/BasicsOfAUTOSAR/MyECU.ecuc.arxml

I get this readout in cmd (win10):
`
C:\Python27\Scripts>canconvert -vv D:\user\ECUexample.arxml D:\user\ECUexampleAAA.xlsx
INFO - convert - Importing D:\user\ECUexample.arxml ...
DEBUG - arxml - Read arxml ...
DEBUG - arxml - Done

DEBUG - arxml - Build arTree ...
DEBUG - arxml - Done

DEBUG - arxml - DEBUG 0 frames in arxml...
DEBUG - arxml - DEBUG 0 can-frame-triggering in arxml...
DEBUG - arxml - DEBUG 0 SIGNAL-TO-PDU-MAPPINGS in arxml...
DEBUG - arxml - DEBUG 0 I-SIGNAL-TO-I-PDU-MAPPING in arxml...
INFO - convert - done

INFO - convert - Exporting D:\user\ECUexampleAAA.xlsx ...
INFO - convert - done
`

@ebroecker
Copy link
Owner

Hi @andraflandra
this is an ECUC-ARXML.

Conversion will only work with an SYSTEM-DESCRIPTION-ARXML

@andraflandra
Copy link
Author

andraflandra commented Feb 7, 2019

How might I get this to work with ECUC-ARXML? Could your code be modified slightly or is a completely new solution needed?

edit:

Also, I found a System-ARXML file online and when trying to convert to .xlsx I get this:
DEBUG - arxml - Read arxml ...
DEBUG - arxml - Done

DEBUG - arxml - Build arTree ...
DEBUG - arxml - Done

DEBUG - arxml - DEBUG 0 frames in arxml...
DEBUG - arxml - DEBUG 0 can-frame-triggering in arxml...
DEBUG - arxml - DEBUG 0 SIGNAL-TO-PDU-MAPPINGS in arxml...
DEBUG - arxml - DEBUG 12 I-SIGNAL-TO-I-PDU-MAPPING in arxml...

And when trying to compare two .arxml files this happens:
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\Scripts\cancompare.exe_main
.py", line 9, in
File "c:\python27\lib\site-packages\canmatrix\compare.py", line 549, in main
db1 = next(iter(canmatrix.formats.loadp(matrix1).values()))
StopIteration

@ebroecker ebroecker self-assigned this Feb 8, 2019
@ebroecker ebroecker changed the title Getting 0 frames in arxml with various .arxml files Support for ECUC ARXMLs Feb 8, 2019
@ebroecker
Copy link
Owner

please try branch
https://github.com/ebroecker/canmatrix/tree/iss281

pip install git+https://github.com/ebroecker/canmatrix@iss281#egg=canmatrix

@andraflandra
Copy link
Author

andraflandra commented Feb 11, 2019

First of all, thank you very much for your effort!

I can now convert the files but from the 1.329KB file all I get is a 6KB .xlsx table with only the first line of data as far as I can tell.

This is the readout in cmd:
INFO - arxml - seems to be a ECUC arxml. Very limited support for extracting canmatrix.
DEBUG - xls - DEBUG: Length of db.frames is 2

(this is the .arxml file I linked in the issue converted to .xlsx)
ECUexampleCONVERTED.xlsx

Also, the actual, non-example .arxml files I need to convert are still getting the line of "DEBUG 0 frames".
If there is any more info I can give you to make this work please let me know!,

edit: I also get this when trying to compare .arxml files:
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\Scripts\canconvert.exe_main
.py", line 9, in
File "c:\python27\lib\site-packages\canmatrix\convert.py", line 402, in main
convert(infile, outfileName, **cmdlineOptions.dict)
File "c:\python27\lib\site-packages\canmatrix\convert.py", line 43, in convert
dbs = canmatrix.formats.loadp(infile, **options)
File "c:\python27\lib\site-packages\canmatrix\formats.py", line 64, in loadp
return load(fileObject, importType, key, flatImport, **options)
File "c:\python27\lib\site-packages\canmatrix\formats.py", line 74, in load
dbs = moduleInstance.load(fileObject, **options)
File "c:\python27\lib\site-packages\canmatrix\arxml.py", line 1583, in load
com_module = arGetPath(searchPoint, "ActiveEcuC/Com")
File "c:\python27\lib\site-packages\canmatrix\arxml.py", line 908, in arGetPath
ptr = ptr.getChild(p)
AttributeError: 'lxml.etree._Element' object has no attribute 'getChild'

Thanks again.

@ebroecker
Copy link
Owner

@andraflandra
what is the output of
canconvert -vv your_non_example.arxml some_test.dbc

Is there actual a Can-Bus defined in the ARXML?

@andraflandra
Copy link
Author

andraflandra commented Feb 11, 2019

This is the output of said command in cmd:

C:\Users\user1>canconvert -vv D:\file.arxml D:\some_test.dbc
INFO - convert - Importing D:\file.arxml ...
DEBUG - arxml - Read arxml ...
DEBUG - arxml -  Done

DEBUG - arxml - Build arTree ...
DEBUG - arxml -  Done

DEBUG - arxml - DEBUG 0 frames in arxml...
DEBUG - arxml - DEBUG 0 can-frame-triggering in arxml...
DEBUG - arxml - DEBUG 0 SIGNAL-TO-PDU-MAPPINGS in arxml...
DEBUG - arxml - DEBUG 0 I-SIGNAL-TO-I-PDU-MAPPING in arxml...
INFO - convert - done

INFO - convert - Exporting D:\some_test.dbc ...
INFO - convert - done

However, this does not actually output/create any .dbc file.
(but doing the line on the example code gets me the same 2 frame file but in .dbc)

As for your question, these are the opening lines of the file:

REDACTED

@ebroecker
Copy link
Owner

Hi @andraflandra ,

Thanks.
what kind of ARXML is this? In what context did you get this file?

The debug output looks like there is no CAN communication defined in this ARXML:

DEBUG - arxml - DEBUG 0 frames in arxml...
DEBUG - arxml - DEBUG 0 can-frame-triggering in arxml...
DEBUG - arxml - DEBUG 0 SIGNAL-TO-PDU-MAPPINGS in arxml...
DEBUG - arxml - DEBUG 0 I-SIGNAL-TO-I-PDU-MAPPING in arxml...

@andraflandra
Copy link
Author

It's from a model input, basically a database of host architecture for automotive. I do have a separate .dbc file that has CAN signals database on them.

I'm new to this so please excuse my ignorance.

@ebroecker
Copy link
Owner

If the ARXMLs describe a SWC (Software component) it will mostely certain not be any CAN information in it.

@andraflandra
Copy link
Author

andraflandra commented Feb 13, 2019

There are SWC components included so I would assume you are correct. Does this make it impossible to use canmatrix to port my kind of arxml to xlsx or can it be enhanced perhaps?

@ebroecker
Copy link
Owner

Sorry - this is a really complete other use case.
Something like extracting sender/receiver ports or/and exporting client/server ports from SWC-ARXML is a complete other work than exporting CAN communication information

@andraflandra
Copy link
Author

Thank you for all the help in any case. I will try to find a different solution or build my own.

ebroecker added a commit that referenced this issue Feb 19, 2019
* add limited support for ECUc-Files #281
* add basic test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants