Floating values not supported in canDataBase

2 visualizaciones (últimos 30 días)
Jyothikumar
Jyothikumar el 9 de Sept. de 2024
Respondida: Jyothikumar el 9 de Sept. de 2024
Scenario :
  • I am planning to construct a canMessage which contains single with "floating value".
  • class "canDatabase" is updating the float value incorrectly in "data" section.
Example :
% consider a valid DBC is loaded into `candb` varaiable
% consider a can message 'EngineState' with signal name 'Velocity`
% As per the DBc file, Signal 'Velocity' is a floating value with 4 digit precision
messageObj = canMessage(candb, "EngineState");
messageObj.Signals.Velocity = 127.1;
disp(messageObj.Signals.Velocity)
% Expected : 127.1
% Actual : 127.0938
Please support on fixing the issue with float data in 'canDatabase'.

Respuesta aceptada

Jyothikumar
Jyothikumar el 9 de Sept. de 2024
[Resolved]
The float values are stored as integer multiple of "Signal.Factor". I got this mismatch.
Now I am entering the input values as integer multiplication of "Signal.Factor" to avoid the discrepency.

Más respuestas (0)

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by