LE/BE and Swapped
Just two cents from someone working with and writing various slave and master implementations for Modbus for around 20 years now.
-
Modbus is Big Endian, also referred to as "network byte order" - the most common endianness for communication. When Open ModSim is set to "LE" (which is also the default) it decodes big-endian values correctly - this seems straight up wrong to me.
Example: For a single register: [ 0x01, 0x02 ] in that order in a serial or TCP stream means 0x0102 or 258 decimal. This is indisputably big-endian interpretation, as per the definition of endianness as well as the modbus specification. -
The most common way, by far, to send multi-register values is most significant word/register first. When Open ModSim is set to "Swapped" (my preference is the less ambiguous term "Reversed") it decodes these correctly - a bit confusing
Example: For a 32-bit register: [ 0x01, 0x02, 0x03, 0x04 ] in that order in the stream most commonly means 0x01020304 or 16909060 decimal. This is most significant word/register first and the most common (easily 90% or more) order, thus a little irksome to call "Swapped".
Oh and, yeah, someone (you) finally did this! Great f---ing work! Seriously, this was direly needed (because ugh... modbustools.com ammirite?)