Raspberry PI connect to RS485

Thank you for all the help. I get it working now. The following is my flow to turn on/off and set frequency for the first controller.

[{"id":"1362989f.2b4cb7","type":"debug","z":"76d2f80e.a06eb8","name":"fan1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":370,"y":60,"wires":[]},{"id":"7fba4baf.61bbb4","type":"modbus-read","z":"76d2f80e.a06eb8","name":"Read Fan1","topic":"","showStatusActivities":true,"logIOActivities":false,"showErrors":true,"unitid":"1","dataType":"HoldingRegister","adr":"4097","quantity":"5","rate":"10","rateUnit":"s","delayOnStart":true,"startDelayTime":"2","server":"782a4491.d4e49c","useIOFile":false,"ioFile":"","useIOForPayload":false,"x":150,"y":80,"wires":[["1362989f.2b4cb7"],["c2b737df.145e58"]]},{"id":"c2b737df.145e58","type":"modbus-response","z":"76d2f80e.a06eb8","name":"","registerShowMax":20,"x":400,"y":120,"wires":[]},{"id":"4e46567.f7c03a8","type":"modbus-write","z":"76d2f80e.a06eb8","name":"TurnOn fan1","showStatusActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"4096","quantity":"1","server":"782a4491.d4e49c","x":310,"y":220,"wires":[["b2e5c3a.166704"],["9a23ceff.113aa"]]},{"id":"b8d3e2e6.54d91","type":"inject","z":"76d2f80e.a06eb8","name":"","topic":"","payload":"1","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":220,"wires":[["4e46567.f7c03a8"]]},{"id":"9a23ceff.113aa","type":"modbus-response","z":"76d2f80e.a06eb8","name":"","registerShowMax":20,"x":510,"y":220,"wires":[]},{"id":"b2e5c3a.166704","type":"debug","z":"76d2f80e.a06eb8","name":"fan1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":490,"y":180,"wires":[]},{"id":"382e597b.cc9d06","type":"modbus-write","z":"76d2f80e.a06eb8","name":"Frequency","showStatusActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"1","quantity":"1","server":"782a4491.d4e49c","x":250,"y":280,"wires":[["19d380ba.82b28f"],["e9dabafa.7e0988"]]},{"id":"acc75bfa.f34f68","type":"inject","z":"76d2f80e.a06eb8","name":"","topic":"","payload":"5000","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":280,"wires":[["382e597b.cc9d06"]]},{"id":"e9dabafa.7e0988","type":"modbus-response","z":"76d2f80e.a06eb8","name":"","registerShowMax":20,"x":490,"y":300,"wires":[]},{"id":"19d380ba.82b28f","type":"debug","z":"76d2f80e.a06eb8","name":"fan1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":470,"y":260,"wires":[]},{"id":"5428f4dc.d6338c","type":"modbus-write","z":"76d2f80e.a06eb8","name":"TurnOff fan1","showStatusActivities":false,"showErrors":false,"unitid":"1","dataType":"HoldingRegister","adr":"4096","quantity":"1","server":"782a4491.d4e49c","x":270,"y":340,"wires":[["cf829dcd.26896"],["bcbe64fb.e57838"]]},{"id":"9547ebe6.6afcc8","type":"inject","z":"76d2f80e.a06eb8","name":"","topic":"","payload":"5","payloadType":"str","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":110,"y":340,"wires":[["5428f4dc.d6338c"]]},{"id":"bcbe64fb.e57838","type":"modbus-response","z":"76d2f80e.a06eb8","name":"","registerShowMax":20,"x":450,"y":380,"wires":[]},{"id":"cf829dcd.26896","type":"debug","z":"76d2f80e.a06eb8","name":"fan1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":450,"y":340,"wires":[]},{"id":"782a4491.d4e49c","type":"modbus-client","z":"","name":"","clienttype":"simpleser","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB0","serialType":"RTU","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true}]
2 Likes