stream icon indicating copy to clipboard operation
stream copied to clipboard

IllegalData while trying to write multiple coils

Open Ziemix opened this issue 7 years ago • 0 comments

I'm trying to write multiple coils at once but I'm getting IllegalData error. I can write single coils without any problem, maybe that's not the format that I should use? If not, what should I use instead? Also, how should I format the buffers for writing registers?

modbus.tcp.connect(device.port, device.ip, { debug: null }, (err, connection) => {
                connection.writeMultipleCoils({address: address, value: [1,0,0,0,1,1,1,0], extra: {unitId: device.id_slave}}, (err, data) => {
                });
          });

Ziemix avatar Nov 26 '19 13:11 Ziemix