Hi @UnborN , I somehow got a little bit closer to a solution. With a direct rs485 connection from PC to the device, I'm able to make a connection now. Connection wiring required was not according to installer his input. Manufacturer input was required to solve.
I'm also able now to turn on and off the heater (the only modbus commands possible) through node-red but I have strange behavior:
- only working with modbus flex write node. But I receive 'Error: Data length error, expected 8 got 7'.
So, yes, the heater is responding to this command but error in node-red received.
I tried tcp type 'NORMAL' as well as 'RTU BUFFERED'.
- no errors with modbus write node but heater is not responding.
See flows in attach. I don't see differences between the different nodes.
Also see modbus documentation in attach.
debug partial output:
- datalenght error
buffer: <Buffer 18 b0 70 03 e6 a2 63>,
action: 'receive tcp port strings',
modbus-serial data: <Buffer 00 02 00 00 00 05 18 b0 70 03 e6>
- value NAN (heater not responding to command)
<Buffer 18 b0 70 03 e6 a2 63>,
action: 'receive tcp port strings',
modbus-serial data: <Buffer 00 04 00 00 00 05 18 b0 70 03 e6>
[{"id":"df9895fc.1d9bc8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"d24d8843.423868","type":"modbus-write","z":"df9895fc.1d9bc8","name":"","showStatusActivities":true,"showErrors":true,"unitid":"","dataType":"Coil","adr":"1","quantity":"1","server":"de3861d.00db0a","emptyMsgOnFail":true,"keepMsgProperties":false,"x":300,"y":80,"wires":[[],["5047a561.5e5c8c","18e34049.0c15a"]]},{"id":"e9173015.a459c","type":"inject","z":"df9895fc.1d9bc8","name":"","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":80,"wires":[["d24d8843.423868"]]},{"id":"5047a561.5e5c8c","type":"debug","z":"df9895fc.1d9bc8","name":"2","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":510,"y":120,"wires":[]},{"id":"f31a8a60.0cd698","type":"inject","z":"df9895fc.1d9bc8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":720,"wires":[["afeb507.502b3b"]]},{"id":"afeb507.502b3b","type":"function","z":"df9895fc.1d9bc8","name":"","func":"var buf=Buffer.alloc(2);\nbuf.writeUInt16BE(65280);\nmsg.payload = buf;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":720,"wires":[["2b11e80d.2600f8"]]},{"id":"3e8225b2.b84ffa","type":"inject","z":"df9895fc.1d9bc8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":286,"wires":[["8347a1e8.d9fd6"]]},{"id":"8347a1e8.d9fd6","type":"function","z":"df9895fc.1d9bc8","name":"On","func":"msg.payload = {\n 'value' : 255,\n 'fc' : 5,\n 'unitid' : 16,\n 'address' : 1,\n 'quantity' : 1\n};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":266,"wires":[["6291c251.38a57c"]]},{"id":"57b303d5.95ff8c","type":"function","z":"df9895fc.1d9bc8","name":"Off","func":"msg.payload = {\n 'value' : 0,\n 'fc' : 5,\n 'unitid' : 16,\n 'address' : 1,\n 'quantity' : 1\n};\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":326,"wires":[["6291c251.38a57c"]]},{"id":"41a2472b.6b7ca8","type":"inject","z":"df9895fc.1d9bc8","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":120,"y":326,"wires":[["57b303d5.95ff8c"]]},{"id":"1424f412.d586ac","type":"debug","z":"df9895fc.1d9bc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":610,"y":306,"wires":[]},{"id":"a50e47a7.e69ee8","type":"comment","z":"df9895fc.1d9bc8","name":"Write Digital I/O","info":"","x":120,"y":246,"wires":[]},{"id":"8277ee51.c2843","type":"debug","z":"df9895fc.1d9bc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":590,"y":720,"wires":[]},{"id":"3ede045d.6c5e4c","type":"comment","z":"df9895fc.1d9bc8","name":"modbus flex write","info":"","x":440,"y":266,"wires":[]},{"id":"f43a9634.8f0a88","type":"modbus-response","z":"df9895fc.1d9bc8","name":"","registerShowMax":20,"x":750,"y":346,"wires":[]},{"id":"2b11e80d.2600f8","type":"modbus-write","z":"df9895fc.1d9bc8","name":"","showStatusActivities":true,"showErrors":true,"unitid":"16","dataType":"Coil","adr":"1","quantity":"1","server":"de3861d.00db0a","emptyMsgOnFail":false,"keepMsgProperties":false,"x":420,"y":720,"wires":[[],["8277ee51.c2843","60c3d6f3.8daa48"]]},{"id":"6291c251.38a57c","type":"modbus-flex-write","z":"df9895fc.1d9bc8","name":"","showStatusActivities":true,"showErrors":true,"server":"de3861d.00db0a","emptyMsgOnFail":false,"keepMsgProperties":false,"x":440,"y":326,"wires":[["f43a9634.8f0a88"],["1424f412.d586ac"]]},{"id":"cc5ec9a7.4eecf8","type":"function","z":"df9895fc.1d9bc8","name":"read all Digital Outputs","func":"msg.payload = { 'value': msg.payload,\n 'fc': 1,\n 'unitid': 1,\n 'address': 0x0010 ,\n 'quantity': 8 } \n\nreturn msg;","outputs":1,"noerr":0,"x":1320,"y":160,"wires":[[]]},{"id":"a838ead2.34c1b8","type":"debug","z":"df9895fc.1d9bc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","x":610,"y":500,"wires":[]},{"id":"bb468183.ef7db","type":"modbus-response","z":"df9895fc.1d9bc8","name":"","registerShowMax":20,"x":630,"y":560,"wires":[]},{"id":"bf971d5a.13681","type":"inject","z":"df9895fc.1d9bc8","name":"on dec","topic":"","payload":"255","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":520,"wires":[["96bbe6dc.427a18"]]},{"id":"f45007e1.0ee2e8","type":"inject","z":"df9895fc.1d9bc8","name":"off","topic":"","payload":"0","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":600,"wires":[["96bbe6dc.427a18"]]},{"id":"f87df865.2cb628","type":"inject","z":"df9895fc.1d9bc8","name":"on hex","topic":"","payload":"[\"00FF\"]","payloadType":"bin","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":480,"wires":[["96bbe6dc.427a18"]]},{"id":"a8f16024.4c565","type":"function","z":"df9895fc.1d9bc8","name":"Startup Values","func":"msg.payload = { value:[false, false, false, false], \n'fc': 15, \n'unitid': 1, \n'address': 0, \n'quantity': 4 } \nreturn msg","outputs":1,"noerr":0,"x":1300,"y":120,"wires":[[]]},{"id":"c12f92c3.ea375","type":"inject","z":"df9895fc.1d9bc8","name":"Test off","topic":"","payload":"[0]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":900,"wires":[["326d6039.b4ed7"]]},{"id":"326d6039.b4ed7","type":"function","z":"df9895fc.1d9bc8","name":"Test","func":"msg.payload = { value: msg.payload, 'fc': 5, 'unitid': 16, 'address': 1 , 'quantity': 1 } \nreturn msg;","outputs":1,"noerr":0,"x":250,"y":900,"wires":[["338dac8e.023244"]]},{"id":"86465dab.2bb73","type":"comment","z":"df9895fc.1d9bc8","name":"The problem was that I had put 0010 as the address in the modbus write node instead of","info":"","x":1360,"y":280,"wires":[]},{"id":"3a69747c.da8e6c","type":"function","z":"df9895fc.1d9bc8","name":"","func":"msg.payload = new Buffer([0x01,0x03,0x0C,0x82,0x00,0x01,0x27,0x72]);","outputs":1,"noerr":0,"x":1110,"y":160,"wires":[[]]},{"id":"862551b4.62feb","type":"comment","z":"df9895fc.1d9bc8","name":"volgens filmpje is unit id slave device and address is register","info":"https://www.youtube.com/watch?v=47Lq2WLkfyE&ab_channel=FreeWaveTechnologies","x":1280,"y":200,"wires":[]},{"id":"b2f20e6d.4d51","type":"comment","z":"df9895fc.1d9bc8","name":"aangezien modbus tcp, is unit id overbodig omdat devices identificeren als ip address","info":"https://control.com/forums/threads/modbus-tcp-what-is-the-correct-usage-of-unit-id.38871/","x":1350,"y":240,"wires":[]},{"id":"18e34049.0c15a","type":"modbus-response","z":"df9895fc.1d9bc8","name":"","registerShowMax":20,"x":550,"y":80,"wires":[]},{"id":"60c3d6f3.8daa48","type":"modbus-response","z":"df9895fc.1d9bc8","name":"","registerShowMax":20,"x":500,"y":780,"wires":[]},{"id":"338dac8e.023244","type":"modbus-write","z":"df9895fc.1d9bc8","name":"","showStatusActivities":false,"showErrors":false,"unitid":"16","dataType":"Coil","adr":"1","quantity":"1","server":"de3861d.00db0a","emptyMsgOnFail":false,"keepMsgProperties":false,"x":300,"y":960,"wires":[["ac93bc1a.3d57e","f4cafceb.f4ca1"],["f4cafceb.f4ca1"]]},{"id":"ac93bc1a.3d57e","type":"modbus-response","z":"df9895fc.1d9bc8","name":"","registerShowMax":20,"x":460,"y":880,"wires":[]},{"id":"f4cafceb.f4ca1","type":"debug","z":"df9895fc.1d9bc8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","x":510,"y":960,"wires":[]},{"id":"ce0d7cb4.888c2","type":"inject","z":"df9895fc.1d9bc8","name":"Test On","topic":"","payload":"[255]","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":960,"wires":[["326d6039.b4ed7"]]},{"id":"3f4e02cc.66682e","type":"modbus-flex-write","z":"df9895fc.1d9bc8","name":"","showStatusActivities":true,"showErrors":true,"server":"de3861d.00db0a","emptyMsgOnFail":false,"keepMsgProperties":false,"x":390,"y":480,"wires":[["a838ead2.34c1b8","bb468183.ef7db"],[]]},{"id":"96bbe6dc.427a18","type":"function","z":"df9895fc.1d9bc8","name":"Test","func":"msg.payload = { \n value: msg.payload, \n 'fc': 5, \n 'unitid': 16, \n 'address': 1, \n 'quantity': 1\n};\nreturn msg;","outputs":1,"noerr":0,"x":250,"y":540,"wires":[["3f4e02cc.66682e"]]},{"id":"dafe5b9b.3f9598","type":"comment","z":"df9895fc.1d9bc8","name":"This one is working but give data lenght error","info":"","x":210,"y":206,"wires":[]},{"id":"9f98505.1209cb","type":"comment","z":"df9895fc.1d9bc8","name":"Not working","info":"","x":110,"y":40,"wires":[]},{"id":"93d268e9.d29fa8","type":"comment","z":"df9895fc.1d9bc8","name":"This one with write node does not work. Neither with flex write node (I think)","info":"","x":300,"y":440,"wires":[]},{"id":"65e0dea9.1715","type":"comment","z":"df9895fc.1d9bc8","name":"Not working","info":"","x":110,"y":680,"wires":[]},{"id":"4690c901.df8578","type":"comment","z":"df9895fc.1d9bc8","name":"some comments and trials to keep","info":"","x":1200,"y":60,"wires":[]},{"id":"e28dde3d.056e6","type":"comment","z":"df9895fc.1d9bc8","name":"Not working","info":"","x":110,"y":860,"wires":[]},{"id":"de3861d.00db0a","type":"modbus-client","z":"","name":"MyRealMobusHeating","clienttype":"tcp","bufferCommands":false,"stateLogEnabled":true,"queueLogEnabled":false,"tcpHost":"192.168.0.50","tcpPort":"502","tcpType":"TPC-RTU-BUFFERED","serialPort":"USB\\ROOT_HUB30\\4&2a1bd118&0&0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"","commandDelay":200,"clientTimeout":3000,"reconnectOnTimeout":true,"reconnectTimeout":2000,"parallelUnitIdsAllowed":false}]
Building Management System.pdf (91.0 KB)