I have a simple flow (pasted below, screenshot as well) that grabs Modbus data for a variable frequency drive (VFD) every 30 seconds via Modbus-TCP. Works great, however...
Yesterday we saw this in Influx:
We have since confirmed via our electrical usage data that the VFD was OFF (for reasons that are unknown at the moment). The problem is that Node-RED seems to have retained the last known value (62.93, taken about 15:52) and kept sending that value to InfluxDB until the VFD came back online about 21:20. This appears as a flat line at 62.93, but we really expected to see 0.
Is there a clever way for me to prevent this "stale" value from being sent to InfluxDB? I do not have Node-RED logs for this period shown.
[{"id":"8a7d4c278f437686","type":"modbus-read","z":"9cb29d33.c5004","name":"Read Data on 30 Quench Pump VFD","topic":"","showStatusActivities":false,"logIOActivities":false,"showErrors":false,"unitid":"255","dataType":"HoldingRegister","adr":"200","quantity":"3","rate":"30","rateUnit":"s","delayOnStart":false,"startDelayTime":"","server":"d99cd9271877f6fc","useIOFile":false,"ioFile":"","useIOForPayload":false,"emptyMsgOnFail":false,"x":230,"y":1460,"wires":[["f480dd6ce0645ebe"],[]]},{"id":"f480dd6ce0645ebe","type":"function","z":"9cb29d33.c5004","name":"","func":"msg.payload = [\n [{\n RotationalSpeed: msg.payload[0]/100,\n },\n {\n MeasType:\"setpoint\",\n EquipElement:\"quenchpump\",\n EquipNumber:\"30\"\n }],\n [{\n ElectricalCurrent: msg.payload[1]/100,\n },\n {\n MeasType:\"actual\",\n EquipElement:\"quenchpump\",\n EquipNumber:\"30\"\n }],\n [{\n ElectricalVoltage: msg.payload[2]/10,\n },\n {\n MeasType:\"actual\",\n EquipElement:\"quenchpump\",\n EquipNumber:\"30\"\n }]\n];\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":620,"y":1460,"wires":[["25a2db017b2ae3ed"]]},{"id":"25a2db017b2ae3ed","type":"influxdb out","z":"9cb29d33.c5004","influxdb":"a5483d9bc0c8a1db","name":"Influx","measurement":"DoubleRotaryFurnaceElementData","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"heattreat","bucket":"AMPdata","x":850,"y":1460,"wires":[]},{"id":"d99cd9271877f6fc","type":"modbus-client","name":"Mitsubishi 30HP VFD for #30 Quench Pump","clienttype":"tcp","bufferCommands":true,"stateLogEnabled":false,"queueLogEnabled":false,"tcpHost":"192.168.10.51","tcpPort":"502","tcpType":"DEFAULT","serialPort":"/dev/ttyUSB","serialType":"RTU-BUFFERD","serialBaudrate":"9600","serialDatabits":"8","serialStopbits":"1","serialParity":"none","serialConnectionDelay":"100","unit_id":"1","commandDelay":"1","clientTimeout":"1000","reconnectOnTimeout":true,"reconnectTimeout":"2000","parallelUnitIdsAllowed":true},{"id":"a5483d9bc0c8a1db","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"","usetls":false,"tls":"","influxdbVersion":"2.0","url":"http://192.168.10.25:8086","rejectUnauthorized":false}]