TDS module from the TQS product line is a four digit 7-segment LED display with two universal indicators. TDS communicates over RS485 line via a simple protocol.
With the Node-RED automation system, you can easily display your own values on the display. The following figure and source code of the example are a basic example of how to display the current time in the format hh:mm.
Flow from this example writes the current time to the display using Modbus RTU (node-red-contrib-modbus). The value on the display is updated once a minute.
[{"id":"b7c936b3.915378","type":"modbus-write","z":"9c7afede.59e65","name":"","showStatusActivities":false,"showErrors":false,"unitid":"49","dataType":"MHoldingRegisters","adr":"100","quantity":"5","server":"6984e91f.37d4f","emptyMsgOnFail":false,"keepMsgProperties":false,"x":560,"y":460,"wires":[["2ac28b3.c6ef6f4"],[]]},{"id":"2ac28b3.c6ef6f4","type":"debug","z":"9c7afede.59e65","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":780,"y":460,"wires":[]},{"id":"63dbbf45.0151b","type":"function","z":"9c7afede.59e65","name":"Show TDS","func":"let dte = new Date();\nlet mm = dte.getMinutes().toString().padStart(2, '0');\nlet hh = dte.getHours().toString().padStart(2, ' ');\nlet str = hh + '.' + mm;\n\nlet arr = [];\n[...str].forEach(chr => arr.push(chr.charCodeAt(0)));\n\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":460,"wires":[["b7c936b3.915378"]]},{"id":"fbf4342d.42faa8","type":"inject","z":"9c7afede.59e65","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"onceDelay":0.1,"x":210,"y":460,"wires":[["63dbbf45.0151b"]]},{"id":"6984e91f.37d4f","type":"modbus-client","z":"","name":"","clienttype":"serial","bufferCommands":false,"stateLogEnabled":false,"tcpHost":"127.0.0.1","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyAMA0","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"1000","unit_id":"","commandDelay":1,"clientTimeout":1000,"reconnectTimeout":3000}]
WEBVyrobce | Papouch.com |