0

Background / Introducion

CAN message Mercedes-Benz, cannot determine 16-bit data type for temperature.

7E 00 32 01 37 00

According to @rnd-ash (who has reverse engineered ACTIA Basic XS Monitor Software) message is structured data type composed of four values. Now we have bit length + offset but unfortunately data type is unknown.

ECU NAME: SAM_V_A2, ID: 0x0017. MSG COUNT: 4
    MSG NAME: T_AUSSEN_B - (°C) (° C) Outside air temperature, OFFSET 0, LENGTH 8
    MSG NAME: P_KAELTE - (bar) (Bar) pressure refrigerant R134a, OFFSET 8, LENGTH 16
    MSG NAME: T_KAELTE - (°C) (° C) temperature refrigerant R134a, OFFSET 24, LENGTH 16
    MSG NAME: I_KOMP - (mA) (MA) current compressor main control valve, OFFSET 40, LENGTH 8

@ProjectPhysX suggested it is probably 8/16-bit integer and big endian, so I created that struct. Figured out how to calculate value 0, 1, 3 but unfortunately struggling with value 2

typedef struct SAM_V_A2_t {
  uint8_t T_AUSSEN_B;
  uint16_t P_KAELTE;
  uint16_t T_KAELTE;
  uint8_t I_KOMP;
} SAM_V_A2_t;

Based on that pictures I can confirm the calculation except for T_KAELTE, which is target of this question (see below).

std::cout << "T_AUSSEN_B = " << +( (SAM_V_A2.T_AUSSEN_B - 80) / 2 ) << " (°C) Outside air temperature"               << std::endl;
std::cout << "P_KAELTE = "   << +( SAM_V_A2.P_KAELTE / 10 )         << " (bar) pressure refrigerant R134a"           << std::endl;
std::cout << "T_KAELTE = "   << +( (SAM_V_A2.T_KAELTE - 80) / 2 )   << " (°C) temperature refrigerant R134a"         << std::endl;
std::cout << "I_KOMP = "     << +( SAM_V_A2.I_KOMP * 10 )           << " (mA) current compressor main control valve" << std::endl;

  7E             00 32               01 37             00

01111110   00000000 00110010   00000001 00110111   00000000

 126               50                 311               0

 126 - 80 / 2      50 / 10             ?                0 * 10

  23°C              5 bar              ? °C             0 mA

Question

My last hope was it could be binary16 or bfloat16 but no luck. Maybe it is some proprietary 16-bit floating-point format with different bits for exponent / mantissa

Maybe we can brute force all permutations for exponent / mantissa to determine data type.
Question: How can we decode 01 37 so it gives expected value ~ 21.10 °C

(more sample data here)

4
  • @ProjectPhysX temperature T_KAELTE must be sensor B12/2 on picture 3 and i believe hardware is in voltage
    – alecxs
    Aug 7, 2021 at 13:10
  • this is the hardware hehlhans.de/sl55amg-sam-1.htm#b21 and the sensor google.com/search?q=A2038300372
    – alecxs
    Aug 7, 2021 at 16:46
  • datasheet seems not helpful (DATA SEGMENT REGISTER 3 + 4 looks like this)
    – alecxs
    Aug 7, 2021 at 17:11
  • think i got it. it is (x - 100) / 10 have confirmed with other records 0x01C4 = 35.2 °C, 0x01D6 = 37.0 °C
    – alecxs
    Aug 8, 2021 at 6:48

1 Answer 1

2

Maybe it is the temperature in Kelvin: 311 - 80/2 = 217K = -2.15°C

Or the offset is different than 80/2. A 16-bit floating-poitn format, especially a different one from IEEE-754 is highly unlikely. Such measurement chips are not more but simple ADCs, they lack the capabilities to convert their reading to floating-point.

To be sure, you would have to take several readings. If you expect that temperature fluctuates by a few °C between measurements, then in 00000001 00110111 only the last few bits should change.

If you have access to the hardware, read the serial number off the chip package and look it up, maybe you find the data sheet that documents the data format of measurements.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.