rossmann-engineering/EasyModbusTCP.NET

Writing 32 bit value

AlekseyHS opened this issue · 2 comments

Is it possible to have write function like "Write Single Registry" but in int32 format?
At the moment by analysing the code i notice even if there is a value type int, it is not an int32 but it is int16.

No, there are no 32bit registers in modbus. If you need to write a 32bit int, it will be stored in two adjacent registers.
For that, use public static int[] ConvertIntToRegisters(Int32 intValue). It will return an array of two 4-bytes arrays, the lowest two bytes of which contains your two 16bits register.

Ok thanks for the explanation