Hello,
I'm trying to write a single coil on a modbus RTU relay board (RS485).
I'm using Modbus-contrib-serial Library.
I'm able to read value from another board on the same bus using Modbus serial In
I'm able to set the coil using another program. (
[19:44:28,813] <--:01 05 00 07 FF 00 3D FB
[19:44:28,891] -->:01 05 00 07 FF 00 3D FB
[19:44:47,641] <--:01 05 00 08 00 00 4C 08
[19:44:47,703] -->:01 05 00 08 00 00 4C 08 )
For the case device address is 01 coil is #7.
Can someone help me with the parameters I need to pass to modbus serial out ?
I tried to format a buffer using binary rpm without success
[0,5,0,0,0,7,255,0]
[{"id":"bce5d2b8.b20d9","type":"debug","z":"f8edcdbe.3d29c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":910,"y":2720,"wires":[]},{"id":"63a52c55.0c9b64","type":"function","z":"f8edcdbe.3d29c","name":"Set Modbus Read Parameters for Serial Number","func":"//Fermer relais #8 \n//[19:44:28,891] -->:01 05 00 07 FF 00 3D FB \n//Ca marche, les adresses vont de 00 a 0F\nmsg.payload = { //'unitid': 0x01,\n 'fc': 0x05,\n 'address': 0x007, // read address\n 'type': 0xFF00\n //,'chc': 0x3DFB\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":2860,"wires":[["bce5d2b8.b20d9","933c5f71.26dea"]]},{"id":"7d9598cd.2e6b78","type":"inject","z":"f8edcdbe.3d29c","name":"","topic":"/1","payload":"On","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"4","x":450,"y":2860,"wires":[["bce5d2b8.b20d9","63a52c55.0c9b64"]]},{"id":"592b7c3.7a94c84","type":"modbusSerial out","z":"f8edcdbe.3d29c","port":"773e9c89.131534","slave":"","start":"0","dtype":"coil","topic":"","name":"","x":1510,"y":2860,"wires":[]},{"id":"a10f743c.7bbb58","type":"inject","z":"f8edcdbe.3d29c","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":"4","x":450,"y":2960,"wires":[["bce5d2b8.b20d9","61cafbf2.78d8d4"]]},{"id":"933c5f71.26dea","type":"binary","z":"f8edcdbe.3d29c","name":"","property":"payload","pattern":"b16 => fc, b32 => address ,b16 => type","x":1230,"y":2860,"wires":[["592b7c3.7a94c84","bce5d2b8.b20d9"]]},{"id":"61cafbf2.78d8d4","type":"function","z":"f8edcdbe.3d29c","name":"Set Modbus Read Parameters for Serial Number","func":"//Fermer relais #8 \n//[19:44:28,891] -->:01 05 00 07 FF 00 3D FB \n//Ca marche, les adresses vont de 00 a 0F\nmsg.payload = { // 'unitid': 0x01,\n 'fc': 0x05,\n 'address': 0x007, // read address\n 'type': 0x0000\n //'chc': 0x3DFB\n};\n\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":2960,"wires":[["933c5f71.26dea"]]},{"id":"773e9c89.131534","type":"modbusSerialConfig","z":"","port":"/dev/ttyUSB0","baud":"9600","data":"8","parity":"none","stop":"1","name":""}]
thanks for your help