Possible problem with Modbus and coil (bit) registers?

Hi,
I just hooked up our Idegis pool control and while reading works perfectly I had problem to write to coils. I want to add that writing to holding registers works perfectly and also reading with input/holding/coils work flawless.

As an additional caveat, the Modus connection is not direct TCP to the controller, but I use a Modbus RTU/TCP converter “USR-DR302” as the pool control supports only RTU protocol.

So basically I started with a single coil to test the control of a relay that would control our illumination:

	Bridge poller output4 "Poller - pool - domotic 2 - output 4 / illumination" [ start = 4862, length = 1, refresh = 10000, type = "coil" ] {
		Thing data Output4Switch [ readStart = "4862", readValueType = "bit", writeStart = "4862", writeValueType = "bit", writeType = "coil" ]
	}

I got good results with reading the actual values, but writing never worked. I had a good conversation with some tech guy from Idegis and we are now adressing the relay through holding registers as a workaround, but he mentioned it should work with coils as well (which is the basic design from their side for output control, almost everthing is “coiled”).
So just wanted to check if there’s eventually some potential bug lurking around when using “write coil” functionality.

Thanks
Soeren

Writing coils can be performed in two ways - write single or write multiple. It might be that binding uses write multiple while device supports only single function. Or vice versa, its hard to guess, but you can try adding necessary switches to thing config in order to force specific protocol level behavior.

Hi Lukasz,

good idea, I changed the things configuration now to

		Thing data Output4Switch [ readStart = "4862", readValueType = "bit", writeStart = "4862", writeValueType = "bit", writeType = "coil", writeMultipleEvenWithSingleRegisterOrCoil = "true" ]
		Thing data Output4SwitchAuto [ readStart = "4863", readValueType = "bit", writeStart = "4863", writeValueType = "bit", writeType = "coil", writeMultipleEvenWithSingleRegisterOrCoil = "true" ]

But the result now is that even reading now does not reflect the proper state of the coil. I’ll do some more experiments next days hopefully to more pinpoint the problem.

Thanks,
Soeren