Actually the length is number of registers, not the number of bits.
From the documentation
number of data items to read. Data items here refers to registers, coils or discrete inputs depending on the slave type. For example, if the goal is to read one item with valuetype=int32, one needs to read two registers (2 * 16bit = 32bit), thus length = 2. If three coils are of interest, one should specify length = 3
It sounds like reading works but writing does not like you expect??. I think you are suffering from this issue
This has been known issue for quite some time. See also docs for more information:
Note: The way Decimal commands are handled currently means that it is probably not useful to try to use Decimal commands with non-16bit valuetypes.
Relevant section in docs http://docs.openhab.org/addons/bindings/modbus1/readme.html#write
The reason for all of this is that there is no way to write individual bits to registers with modbus (protocol). You can only write whole 16 bit registers.
You can workaround this limitation by keeping the whole register in memory, and combining individual bit with that. It requires rules and additional items. The forum should have some guidance or tips regarding this.