-
assigned issue to
Binary2SignedDecimal Conversion
Hi Tobias,
Thanks for your continuous support.
I can read the ASC log data & I'm trying to decode the message data with help of DBC information.
Here, I have used 10bit binary string for conversion to signed decimal and I have decoded log data to .csv with help of Canalyzer. The converted data is not matching with Canalyzer converted data.
For Example: Binary string is "1000011010" and corresponding signed decimal is "-176". Binary string is "0111010011" and corresponding signed decimal is "108".
I couldn't get the same with general conversion method. Can you give me any suggestions to resolve this issue.
Thanks in Advance!
Regards, Venkatesan S
Comments (5)
-
repo owner -
repo owner Hi Venkat,
so normally this works in two steps:
-
signal.decode() helps you to get the corresponding rawData out of the CAN message. This depends on startBit, bitSize, byteOrder and valueType.
-
signal.rawToPhysicalValue() helps you to convert the raw value into the physical value. This depends on factor and offset.
You gave two examples: 1. rawData="1000011010" (=0x21A=-486) becomes physicalValue="-176". 2. rawData="0111010011" (=0x1D3=467) becomes physicalValue="108".
But, what were your decode values? startBit, bitSize, byteOrder and valueType? And what were your rawToPhysical values? factor and offset?
Bye Tobias
-
-
repo owner - marked as proposal
-
reporter Hi Tobias,
Thanks for your kind reply.
I have followed your suggestion and I got a expected output.
Thanks for your continuous support.
Thanks once again.
Regards, Venkatesan S
-
repo owner - changed status to resolved
- Log in to comment