CAN Endianness

See CAN Endianness if you need to understand how endian numbers can differ and Binary, Decimal and Hexadecimal to get the fundamental concepts.

The config is set to output the decimal value of 305419896 in three different sized parts of the full CAN message. This decimal value, in hexadecimal, is the distinctive 0x12345678. We use this recognisable value to ensure all the byte and bit ordering is correct between the Pilot and the receiver (e.g. data logger). The data is grouped in the CAN message to have a 32bit version (which fits the full 0x12345678), followed by a 24bit value (which can only fit the lower 24 bits, i.e. 0x345678) and a single byte which should is the very last 0x78.

If we look at the message at the receiver in hex, it should be:

MSG 0x400 DLC8 = 12 34 56 78 34 56 78 78

Or, if you decode the three values (32, 24 and 8 bit values) as decimal then you should get 305419896, 3430008 and 120 repeated every second.

File Name: CAN Endianness.zip
File Size: 261 Byte
File Type: application/zip
Hits: 3539 Hits
Created Date: 2023-04-14
Last Updated Date: 2023-04-14