Hi
MODBUS is Big endian, ok " MODBUS uses a ‘big-Endian’ representation for addresses and data items. This means that when a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. "
For me a 32bit value is without any ambiguity a "numerical quantity larger than a single byte "
For me a 32bit value must be registered in big endian in a MODBUS table.
I discuss with a friend about litle to big endian conversion on an ARM microcontroller and he asserts me that we can (for him we must even) change the endianness only by 16bit register.
For exemple if i have to pass the value 287454020 (0x11223344 ). In my ARM memory this is recorded in little endian (0x44 then 0x33 then 0x22 then 0x11)
For me MODBUS must transmit 0x11 then 0x22 then 0x33 then 0x44 (a nice 32 bit value in big endian), I always saw that.
For me friend MODBUS can (for him we must even) transmit 0x33 then 0x44 (the first register with the reverse endianess ) and then 0x11 then 0x22 (the second register with the reverse endianess)
This mixture of endianess seems very ugly to me. For me a modbus device doesn't have to worry about the endianess of the other device's cpu and not inverting the registers is a 32 bit representation error.
"a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. " is so clear.
Where's the real in there ?
did i miss something in the standard ?
Do you know a slave who uses this barbaric notation for a 32bit (that I look at his definition of the modbus table) ?
thank you very much in advance
MODBUS is Big endian, ok " MODBUS uses a ‘big-Endian’ representation for addresses and data items. This means that when a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. "
For me a 32bit value is without any ambiguity a "numerical quantity larger than a single byte "
For me a 32bit value must be registered in big endian in a MODBUS table.
I discuss with a friend about litle to big endian conversion on an ARM microcontroller and he asserts me that we can (for him we must even) change the endianness only by 16bit register.
For exemple if i have to pass the value 287454020 (0x11223344 ). In my ARM memory this is recorded in little endian (0x44 then 0x33 then 0x22 then 0x11)
For me MODBUS must transmit 0x11 then 0x22 then 0x33 then 0x44 (a nice 32 bit value in big endian), I always saw that.
For me friend MODBUS can (for him we must even) transmit 0x33 then 0x44 (the first register with the reverse endianess ) and then 0x11 then 0x22 (the second register with the reverse endianess)
This mixture of endianess seems very ugly to me. For me a modbus device doesn't have to worry about the endianess of the other device's cpu and not inverting the registers is a 32 bit representation error.
"a numerical quantity larger than a single byte is transmitted, the most significant byte is sent first. " is so clear.
Where's the real in there ?
did i miss something in the standard ?
Do you know a slave who uses this barbaric notation for a 32bit (that I look at his definition of the modbus table) ?
thank you very much in advance