MODBUS String data transfer
Hi,
i'm new to MODBUS; I've implemented a MODBUS TCP server and i think i will need to transmit to a master device some string data.
I think i will use the multiple register (read-only or read/write) read command, but i have some doubts.
The MODBUS transmits 16 bit long registers in big-endian format. if i write the "test" text in a string, for instance, i will have my bytes in this order:
byte 0: 't';
byte 1: 'e';
byte 2: 's';
byte 3: 't'.
so the fist 16 bits word contains the values 't' (LSByte) and 'e' (MSByte) and the second 16 contains 's' (LSByte) and 't' (MSByte).
If the master initiates a multiple registers read, by reading these two words, because the data field is big-endian formatted, the string will arrived in this order:
byte 1: 'e';
byte 0: 't';
byte 3: 't';
byte 2: 's'.
The same thing should happen when i have to transmit a data bigger then a 16 bits word, like a 32 bits integer or a floating point variable.
Is that right?