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

floating point values from DBC file truncated to integer #247

Open
bomm opened this issue Nov 14, 2023 · 2 comments
Open

floating point values from DBC file truncated to integer #247

bomm opened this issue Nov 14, 2023 · 2 comments

Comments

@bomm
Copy link

bomm commented Nov 14, 2023

When loading a DBC file that contains floating point values as factor, min or max value of a signal, the values are truncated to integer.

For example, a factor of 0.01 is truncated to 0, resulting in an error message: signalToRaw():cansignalencoder_p.cpp@143] Factor for Temperature signal is 0! Signal encoding failed. This means the internal value is affected, not only the display in the CanSignalData node.

Example file: https://github.com/cantools/cantools/blob/master/tests/files/dbc/motohawk.dbc

(I don't know if the truncation occurs in CANdb or CANdevStudio.)

@simoneruffini
Copy link

second this, I have the same problem, found a warning like this in the console

[2024-04-08 23:59:32.977] [cds] [error] [signalToRaw():cansignalencoder_p.cpp@143] Factor for HVB_uHvb signal is 0! Signal encoding failed.

@simoneruffini
Copy link

I found the error, the problem is in CANdb check the PR
GENIVI/CANdb#43
The current workaround is to either change your systems locale to one that uses the . as the decimal separator or just launch the application with this line before
export LC_NUMERIC=en_US.UTF-8

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