Modbus data writing issue

Hi,

I’m still not sure if I got the issue / the usecase right.

ModbusTCP itself only knows 2 types: discretes and registers, so if you want to send / receive a int32 value via modbus, this has to be done via 2 related registers.
The’re several possibilities to do this, e.g. by suitable channel configuration, or by splitting the value manually into two 16-bit values when sending (“high” and “low” register) and join them after receiving, by using memcpy over multiple registers → it also depends on the communication partner and it’s (re-)interpretation of the 16-Bit registers, what’s the best way to implement it.

The’re several posts in the Community about Modbus(TCP) data transfer of “non-16 bit” values, for example the following ones.
Even some of them aren’t about ModbusTCP but Modbus RTU and are not covering exactly the int32 value (but other types > 16bit), the context behind is similar.
So maybe they could help answering your question.

Best regards!