stream
stream copied to clipboard
IllegalData while trying to write multiple coils
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) => {
});
});