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

convert ARXML to DBC have error:<class 'decimal.DivisionUndefined'> #766

Open
mrmuyi opened this issue Feb 15, 2024 · 2 comments
Open

convert ARXML to DBC have error:<class 'decimal.DivisionUndefined'> #766

mrmuyi opened this issue Feb 15, 2024 · 2 comments
Assignees

Comments

@mrmuyi
Copy link

mrmuyi commented Feb 15, 2024

I want to convert arxml to dbc, the cmd as "canconvert -vv ess3337.arxml ess377.dbc", log as below, could you kindly help?
python version 3.8.5
canmatrix version 1.0

DEBUG - arxml - PDU: Tester_Sporadic_AtifRequestRFSDA
DEBUG - arxml - processing Frame-Trigger: Tester_BKPCANFD_AtifRequestRHRDA
DEBUG - arxml - Frame: Tester_BKPCANFD_AtifRequestRHRDA
DEBUG - arxml - PDU: Tester_Sporadic_AtifRequestRHRDA
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Program Files\Python38\lib\runpy.py", line 87, in run_code
exec(code, run_globals)
File "C:\Program Files\Python38\Scripts\canconvert.exe_main
.py", line 7, in
File "C:\Program Files\Python38\lib\site-packages\click\core.py", line 1128, in call
return self.main(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\click\core.py", line 1053, in main
rv = self.invoke(ctx)
File "C:\Program Files\Python38\lib\site-packages\click\core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Program Files\Python38\lib\site-packages\click\core.py", line 754, in invoke
return callback(*args, **kwargs)
File "C:\Program Files\Python38\lib\site-packages\canmatrix\cli\convert.py", line 155, in cli_convert
canmatrix.convert.convert(infile, outfile, **options)
File "C:\Program Files\Python38\lib\site-packages\canmatrix\convert.py", line 68, in convert
dbs = canmatrix.formats.loadp(infile, **options)
File "C:\Program Files\Python38\lib\site-packages\canmatrix\formats_init
.py", line 71, in loadp
return load(fileObject, import_type, key, **options)
File "C:\Program Files\Python38\lib\site-packages\canmatrix\formats_init
.py", line 88, in load
dbs = module_instance.load(file_object, **options) # type: ignore
File "C:\Program Files\Python38\lib\site-packages\canmatrix\formats\arxml.py", line 2005, in load
result.update(decode_can_helper(ea, float_factory, ignore_cluster_info))
File "C:\Program Files\Python38\lib\site-packages\canmatrix\formats\arxml.py", line 1923, in decode_can_helper
sig_value_hash[sig.name] = sig.phys2raw()
File "C:\Program Files\Python38\lib\site-packages\canmatrix\canmatrix.py", line 450, in phys2raw
raw_value = (self.float_factory(value) - self.float_factory(self.offset)) / self.float_factory(self.factor)
decimal.InvalidOperation: [<class 'decimal.DivisionUndefined'>]

@ebroecker ebroecker self-assigned this Feb 19, 2024
@ebroecker
Copy link
Owner

Hi @mrmuyi

maybe your Frame "Tester_Sporadic_AtifRequestRHRDA" does not have a compu-method or the compu-method is incomplete.
Canmatrix fails because it does not find "factor" in the scaling of "Tester_Sporadic_AtifRequestRHRDA"

@mrmuyi
Copy link
Author

mrmuyi commented Feb 22, 2024

Hi, thanks for your quick reply!
in order to find where is the 0 factor, i print the message by "print(self.name)..."
question 1: I got the result as follow which is not match in VECTOR tool or notebook

then i try to filter out the error by "if self.factor==0 return 0"
and got another error: 'Nonetype' object has no attribute "soureceline"
print_result_factor_0
vector_result
notebook_results
Nonetype_01
Nonetype_02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants