Modbus-node write coil


I read value from modbus coil and the node returns it as {data : array [8], buffer[1])
when it works and when switch on only data [0]= true and the others false.
I am trying to write value which true or false in this modbus, but I cant know how can I write it in code? I tried Join to convert True value as array, but it doesn't work.
I am not familiar too much with JavaScript, so could you help me, please?

It is not clear to me whether your problem is in decoding the received data, working out what to set the output to, or sending the new value via modbus.

By the way it is not java scripts it is javascript, which is not related to Java. Zero out of ten for those making up the names in the first place.

Sorry for this mistake, I know it is JavaScript and I fixed it.
My question is about writing to modbus coil (sending the new value via modbus). I want to switch the coil on/off. but I don't know how to do it exactly.
In case of reading, it displays as array data[8], and only the first element data[0] is true in case of coil is on and the other elements are false. That means the coil status is only in the first element data[0].
I want send data to put this element false or true. This command should send to the modbus write node. I configured it with address and force single or multiple coil, but in both cases I cant figure out how to write it. I tried many things but they didn't work.

So rather than trying to explain what you want give an example...

What does the data look like from the coil, what have you tried?

I think that @manal is able to interpret the input ok but does not know how to write the required state to the output.

Hello all,

even though this thread is nearly a year old I reopen it.

I want to write a single coil via the modbus-flex-write node.
The node itself works fine with registers, but not with single coils.
Unfortunately i didn't get in description how to adress a single coil.
I would have expected something like 1000.0 for bit 0.

The actual message looks like that:

return {payload: { value: true, fc: 5, unitid: 1, address:1000.0 , quantity: 1 }};

Any ideas?

Cheers KeMa