node-red-contrib-modbus example flow

Example flow from GitHub readme v0.11.27 or v1.0.0 and above

[
    {
        "id": "849ecf81.3ac91",
        "type": "tab",
        "label": "Modbus"
    },
    {
        "id": "e796a117.3f48",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 1040,
        "wires": []
    },
    {
        "id": "9ea1559c.a59748",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 707,
        "y": 1129,
        "wires": []
    },
    {
        "id": "4fde9157.d7b3f",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 700,
        "wires": []
    },
    {
        "id": "8b5fe3ca.e5e17",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "true",
        "x": 850,
        "y": 800,
        "wires": []
    },
    {
        "id": "8c7b00a2.b8d8c",
        "type": "modbus-write",
        "z": "849ecf81.3ac91",
        "name": "Write Reset FC5",
        "showStatusActivities": false,
        "dataType": "Coil",
        "adr": "64",
        "quantity": "1",
        "server": "1a1bd3e7.b5411c",
        "x": 419,
        "y": 990,
        "wires": [
            [
                "c2ffff03.9edba"
            ],
            [
                "2ae9ef2.49f361"
            ]
        ]
    },
    {
        "id": "d08c039a.fd0a6",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "1",
        "crontab": "",
        "once": false,
        "x": 230,
        "y": 980,
        "wires": [
            [
                "8c7b00a2.b8d8c"
            ]
        ]
    },
    {
        "id": "c2ffff03.9edba",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 940,
        "wires": []
    },
    {
        "id": "2ae9ef2.49f361",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": 20,
        "x": 730,
        "y": 980,
        "wires": []
    },
    {
        "id": "303fb636.10457a",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": "10",
        "x": 890,
        "y": 740,
        "wires": []
    },
    {
        "id": "a5c1a87c.e3f598",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "",
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "repeat": "1",
        "crontab": "",
        "once": false,
        "x": 230,
        "y": 1020,
        "wires": [
            [
                "8c7b00a2.b8d8c"
            ]
        ]
    },
    {
        "id": "e0f58d2d.cc965",
        "type": "modbus-read",
        "z": "849ecf81.3ac91",
        "name": "Automatic Read FC3",
        "showStatusActivities": false,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "0",
        "quantity": "10",
        "rate": "10",
        "rateUnit": "s",
        "server": "1a1bd3e7.b5411c",
        "x": 290,
        "y": 840,
        "wires": [
            [],
            [
                "11029b37.b15935",
                "4f5abae6.37cda4"
            ]
        ]
    },
    {
        "id": "13d2dff3.537ae",
        "type": "modbus-getter",
        "z": "849ecf81.3ac91",
        "name": "Half-Automatic Getter FC4",
        "showStatusActivities": false,
        "unitid": "",
        "dataType": "InputRegister",
        "adr": "0",
        "quantity": "10",
        "server": "1a1bd3e7.b5411c",
        "x": 460,
        "y": 740,
        "wires": [
            [
                "4fde9157.d7b3f"
            ],
            [
                "303fb636.10457a",
                "8b5fe3ca.e5e17"
            ],
            [
                "8b5fe3ca.e5e17"
            ]
        ]
    },
    {
        "id": "7a10b862.d87e08",
        "type": "modbus-getter",
        "z": "849ecf81.3ac91",
        "name": "Manual Getter FC3",
        "showStatusActivities": false,
        "dataType": "HoldingRegister",
        "adr": "0",
        "quantity": "10",
        "server": "1a1bd3e7.b5411c",
        "x": 430,
        "y": 1140,
        "wires": [
            [
                "e796a117.3f48"
            ],
            [
                "50c96034.a7313"
            ],
            [
                "9ea1559c.a59748"
            ]
        ]
    },
    {
        "id": "50c96034.a7313",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": "20",
        "x": 733,
        "y": 1078,
        "wires": []
    },
    {
        "id": "78c76f77.3572a",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get!",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "2",
        "crontab": "",
        "once": false,
        "x": 230,
        "y": 1140,
        "wires": [
            [
                "7a10b862.d87e08"
            ]
        ]
    },
    {
        "id": "22b9e600.ffe0fa",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get every second",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "1",
        "crontab": "",
        "once": false,
        "x": 170,
        "y": 740,
        "wires": [
            [
                "13d2dff3.537ae"
            ]
        ]
    },
    {
        "id": "c230262f.32a438",
        "type": "modbus-flex-write",
        "z": "849ecf81.3ac91",
        "name": "",
        "showStatusActivities": false,
        "server": "8a533609.cbd2b8",
        "x": 730,
        "y": 400,
        "wires": [
            [
                "97300740.0925e8"
            ],
            [
                "4077b3c7.4bd61c"
            ]
        ]
    },
    {
        "id": "4077b3c7.4bd61c",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": 20,
        "x": 1050,
        "y": 380,
        "wires": []
    },
    {
        "id": "7730660c.186d88",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write multiple!",
        "topic": "",
        "payload": "[1,2,3,4,5,6,7,8,9,10]",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 340,
        "wires": [
            [
                "3c5147c.4ca49b8"
            ]
        ]
    },
    {
        "id": "97300740.0925e8",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 1030,
        "y": 340,
        "wires": []
    },
    {
        "id": "c6e8a047.0d18b",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": "5",
        "x": 1050,
        "y": 620,
        "wires": []
    },
    {
        "id": "868d2863.806968",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 1030,
        "y": 580,
        "wires": []
    },
    {
        "id": "1f919f42.c6c6e1",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get flexible!",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 620,
        "wires": [
            [
                "da5b7385.cf0fc"
            ]
        ]
    },
    {
        "id": "da5b7385.cf0fc",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Read 0-9 on Unit 1 FC3",
        "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 0 , 'quantity': 10 }\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 620,
        "wires": [
            [
                "6ca57769.ef0428"
            ]
        ]
    },
    {
        "id": "3c5147c.4ca49b8",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Write 0-9 on Unit 1 FC15",
        "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 360,
        "wires": [
            [
                "c230262f.32a438"
            ]
        ]
    },
    {
        "id": "46898dc0.231c64",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Read 10-18 on Unit 1 FC3",
        "func": "msg.payload = { input: msg.payload, 'fc': 3, 'unitid': 1, 'address': 10 , 'quantity': 8 }\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 460,
        "y": 660,
        "wires": [
            [
                "6ca57769.ef0428"
            ]
        ]
    },
    {
        "id": "b412f719.15c7b8",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Write 10-18 on Unit 1 FC15",
        "func": "msg.payload = { value: msg.payload, 'fc': 15, 'unitid': 1, 'address': 10 , 'quantity': 9 };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 460,
        "y": 400,
        "wires": [
            [
                "c230262f.32a438"
            ]
        ]
    },
    {
        "id": "3686df6e.94f",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get flexible!",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 660,
        "wires": [
            [
                "46898dc0.231c64"
            ]
        ]
    },
    {
        "id": "84b68ef.f0dc47",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write wrong multiple!",
        "topic": "",
        "payload": "[1,2,3,4,5,6,7,8,9,10]",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 180,
        "y": 380,
        "wires": [
            [
                "b412f719.15c7b8"
            ]
        ]
    },
    {
        "id": "7dea928f.e847ec",
        "type": "catch",
        "z": "849ecf81.3ac91",
        "name": "",
        "scope": null,
        "x": 140,
        "y": 180,
        "wires": [
            [
                "a0f443b6.ce0ee",
                "2b89f153.2c0d6e",
                "2ea142f.1ce9ebe",
                "f46f1d7f.edfd",
                "424f0eed.8012b"
            ]
        ]
    },
    {
        "id": "a0f443b6.ce0ee",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "true",
        "x": 390,
        "y": 220,
        "wires": []
    },
    {
        "id": "6ca57769.ef0428",
        "type": "modbus-flex-getter",
        "z": "849ecf81.3ac91",
        "name": "",
        "showStatusActivities": false,
        "server": "1a1bd3e7.b5411c",
        "x": 740,
        "y": 640,
        "wires": [
            [
                "868d2863.806968"
            ],
            [
                "c6e8a047.0d18b"
            ]
        ]
    },
    {
        "id": "2b1f7ec1.52d142",
        "type": "modbus-flex-write",
        "z": "849ecf81.3ac91",
        "name": "",
        "showStatusActivities": false,
        "server": "8a533609.cbd2b8",
        "x": 730,
        "y": 540,
        "wires": [
            [
                "6a50d23e.176d2c"
            ],
            [
                "3aea7700.0cbe7a"
            ]
        ]
    },
    {
        "id": "3aea7700.0cbe7a",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": 20,
        "x": 1050,
        "y": 520,
        "wires": []
    },
    {
        "id": "9a4906e0.a24b28",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write wrong multiple!",
        "topic": "",
        "payload": "[1,0,1,0,1,0,1,1]",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 180,
        "y": 500,
        "wires": [
            [
                "aac4a862.ff3158"
            ]
        ]
    },
    {
        "id": "aac4a862.ff3158",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Write 0-9 on Unit 1 FC16",
        "func": "msg.payload = { value: msg.payload, 'fc': 16, 'unitid': 1, 'address': 0 , 'quantity': 10 };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 520,
        "wires": [
            [
                "2b1f7ec1.52d142"
            ]
        ]
    },
    {
        "id": "31529875.cc2458",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Write 10 on Unit 1 FC6",
        "func": "msg.payload = { value: msg.payload, 'fc': 6, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 440,
        "y": 560,
        "wires": [
            [
                "2b1f7ec1.52d142"
            ]
        ]
    },
    {
        "id": "1272101.bfe6ef",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write single!",
        "topic": "",
        "payload": "2345",
        "payloadType": "num",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 580,
        "wires": [
            [
                "31529875.cc2458"
            ]
        ]
    },
    {
        "id": "6a50d23e.176d2c",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 1030,
        "y": 480,
        "wires": []
    },
    {
        "id": "3eadf44f.281f1c",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write single!",
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 460,
        "wires": [
            [
                "e367483.84d87b8"
            ]
        ]
    },
    {
        "id": "e367483.84d87b8",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "Write 10 on Unit 1 FC5",
        "func": "msg.payload = { value: msg.payload, 'fc': 5, 'unitid': 1, 'address': 10 , 'quantity': 1 };\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "x": 440,
        "y": 440,
        "wires": [
            [
                "c230262f.32a438"
            ]
        ]
    },
    {
        "id": "4b45a501.e3cc9c",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "payload",
        "x": 710,
        "y": 1180,
        "wires": []
    },
    {
        "id": "3fc69ffd.b8a0b",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 1220,
        "wires": []
    },
    {
        "id": "f22845fd.b4fbb8",
        "type": "modbus-getter",
        "z": "849ecf81.3ac91",
        "name": "Manual Getter FC1",
        "showStatusActivities": false,
        "dataType": "Coil",
        "adr": "10",
        "quantity": "1",
        "server": "1a1bd3e7.b5411c",
        "x": 430,
        "y": 1280,
        "wires": [
            [
                "4b45a501.e3cc9c"
            ],
            [
                "ceaaddc4.dd2ec"
            ],
            [
                "3fc69ffd.b8a0b"
            ]
        ]
    },
    {
        "id": "ceaaddc4.dd2ec",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": "20",
        "x": 730,
        "y": 1260,
        "wires": []
    },
    {
        "id": "344ef691.02314a",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get!",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "1",
        "crontab": "",
        "once": false,
        "x": 230,
        "y": 1280,
        "wires": [
            [
                "f22845fd.b4fbb8"
            ]
        ]
    },
    {
        "id": "40329930.1325f8",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 1320,
        "wires": []
    },
    {
        "id": "2e2313b0.156b8c",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 710,
        "y": 1360,
        "wires": []
    },
    {
        "id": "ca8debbd.db3f88",
        "type": "modbus-getter",
        "z": "849ecf81.3ac91",
        "name": "Manual Getter FC2",
        "showStatusActivities": false,
        "dataType": "Input",
        "adr": "0",
        "quantity": "10",
        "server": "1a1bd3e7.b5411c",
        "x": 430,
        "y": 1380,
        "wires": [
            [
                "40329930.1325f8"
            ],
            [
                "e400e6d9.2c0858"
            ],
            [
                "2e2313b0.156b8c"
            ]
        ]
    },
    {
        "id": "e400e6d9.2c0858",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": "20",
        "x": 730,
        "y": 1400,
        "wires": []
    },
    {
        "id": "5e6fcdc4.509ad4",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Get!",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "2",
        "crontab": "",
        "once": false,
        "x": 230,
        "y": 1380,
        "wires": [
            [
                "ca8debbd.db3f88"
            ]
        ]
    },
    {
        "id": "76111a02.b7ef44",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write multiple!",
        "topic": "",
        "payload": "[1,2,3,4,5,6,7,8,9]",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 420,
        "wires": [
            [
                "b412f719.15c7b8"
            ]
        ]
    },
    {
        "id": "d4a3e081.06789",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "Write multiple!",
        "topic": "",
        "payload": "[1,0,1,0,1,0,1,1,1,1]",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 150,
        "y": 540,
        "wires": [
            [
                "aac4a862.ff3158"
            ]
        ]
    },
    {
        "id": "d63890ec.cd863",
        "type": "modbus-server",
        "z": "849ecf81.3ac91",
        "name": "",
        "logEnabled": false,
        "serverPort": 10502,
        "responseDelay": "100",
        "delayUnit": "ms",
        "coilsBufferSize": 1024,
        "holdingBufferSize": 1024,
        "inputBufferSize": 1024,
        "x": 720,
        "y": 100,
        "wires": [
            [
                "3cc304f8.e775fc"
            ],
            [
                "3cc304f8.e775fc"
            ],
            [
                "3cc304f8.e775fc"
            ]
        ]
    },
    {
        "id": "397c886f.40d1a8",
        "type": "modbus-queue-info",
        "z": "849ecf81.3ac91",
        "name": "Read Queue",
        "unitid": "",
        "lowLowLevel": 25,
        "lowLevel": 75,
        "highLevel": 150,
        "highHighLevel": 300,
        "server": "1a1bd3e7.b5411c",
        "errorOnHighLevel": false,
        "x": 710,
        "y": 180,
        "wires": [
            [
                "6692d0ed.b7469"
            ]
        ]
    },
    {
        "id": "2b89f153.2c0d6e",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "reset Read on High",
        "func": "if(\"high level reached\" === msg.state && \n    msg.unitid === 1 &&\n    msg.error.source.name === \"Read Queue\") {\n    msg.resetQueue = true;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 430,
        "y": 140,
        "wires": [
            [
                "397c886f.40d1a8"
            ]
        ]
    },
    {
        "id": "2ea142f.1ce9ebe",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "reset Read on HighHigh",
        "func": "if(\"high high level reached\" === msg.state && \n    msg.unitid === 1 &&\n    msg.error.source.name === \"Read Queue\") {\n    msg.resetQueue = true;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 180,
        "wires": [
            [
                "397c886f.40d1a8"
            ]
        ]
    },
    {
        "id": "6692d0ed.b7469",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "false",
        "x": 1030,
        "y": 220,
        "wires": []
    },
    {
        "id": "681db48.36c284c",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "repeat": "",
        "crontab": "",
        "once": false,
        "x": 140,
        "y": 100,
        "wires": [
            [
                "d63890ec.cd863"
            ]
        ]
    },
    {
        "id": "3cc304f8.e775fc",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "true",
        "x": 1010,
        "y": 100,
        "wires": []
    },
    {
        "id": "f46f1d7f.edfd",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "reset Write on High",
        "func": "if(\"high level reached\" === msg.state && \n    msg.unitid === 1  &&\n    msg.error.source.name === \"Write Queue\") {\n    msg.resetQueue = true;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 430,
        "y": 260,
        "wires": [
            [
                "1eaed566.bd5d5b"
            ]
        ]
    },
    {
        "id": "424f0eed.8012b",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "reset Write on HighHigh",
        "func": "if(\"high high level reached\" === msg.state && \n    msg.unitid === 1 &&\n    msg.error.source.name === \"Write Queue\") {\n    msg.resetQueue = true;\n    return msg;\n}\n",
        "outputs": 1,
        "noerr": 0,
        "x": 450,
        "y": 300,
        "wires": [
            [
                "1eaed566.bd5d5b"
            ]
        ]
    },
    {
        "id": "1eaed566.bd5d5b",
        "type": "modbus-queue-info",
        "z": "849ecf81.3ac91",
        "name": "Write Queue",
        "unitid": "",
        "lowLowLevel": "5",
        "lowLevel": "10",
        "highLevel": "15",
        "highHighLevel": "30",
        "server": "8a533609.cbd2b8",
        "errorOnHighLevel": true,
        "x": 710,
        "y": 260,
        "wires": [
            [
                "6692d0ed.b7469"
            ]
        ]
    },
    {
        "id": "11029b37.b15935",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "true",
        "x": 470,
        "y": 840,
        "wires": []
    },
    {
        "id": "4f5abae6.37cda4",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "extract buffer",
        "func": "return { payload: msg.payload.buffer };",
        "outputs": 1,
        "noerr": 0,
        "x": 490,
        "y": 880,
        "wires": [
            [
                "3a55fdc5.810522"
            ]
        ]
    },
    {
        "id": "3a55fdc5.810522",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 670,
        "y": 880,
        "wires": []
    },
    {
        "id": "3987c5be.2badba",
        "type": "modbus-write",
        "z": "849ecf81.3ac91",
        "name": "Write Reset FC5",
        "showStatusActivities": false,
        "unitid": "",
        "dataType": "MHoldingRegisters",
        "adr": "200",
        "quantity": "10",
        "server": "8a533609.cbd2b8",
        "x": 420,
        "y": 1520,
        "wires": [
            [
                "b7b76c44.7416b"
            ],
            [
                "7b4d0f73.653dd"
            ]
        ]
    },
    {
        "id": "b7b76c44.7416b",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 711,
        "y": 1470,
        "wires": []
    },
    {
        "id": "7b4d0f73.653dd",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": 20,
        "x": 731,
        "y": 1510,
        "wires": []
    },
    {
        "id": "aabc5e3f.a3955",
        "type": "inject",
        "z": "849ecf81.3ac91",
        "name": "",
        "topic": "",
        "payload": "[1,2,3,4,5,6,7,8,9,10]",
        "payloadType": "json",
        "repeat": "1",
        "crontab": "",
        "once": false,
        "x": 220,
        "y": 1520,
        "wires": [
            [
                "3987c5be.2badba"
            ]
        ]
    },
    {
        "id": "1bedf4b7.7fbc9b",
        "type": "modbus-read",
        "z": "849ecf81.3ac91",
        "name": "Automatic Read FC3",
        "showStatusActivities": false,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "200",
        "quantity": "10",
        "rate": "1",
        "rateUnit": "s",
        "server": "1a1bd3e7.b5411c",
        "x": 190,
        "y": 1620,
        "wires": [
            [
                "5ba934bc.4d7aec"
            ],
            [
                "f0160b02.6d3878",
                "34f2ef3a.17b59",
                "e7d7b528.ca82e8"
            ]
        ]
    },
    {
        "id": "f0160b02.6d3878",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "true",
        "x": 390,
        "y": 1660,
        "wires": []
    },
    {
        "id": "34f2ef3a.17b59",
        "type": "function",
        "z": "849ecf81.3ac91",
        "name": "extract buffer",
        "func": "return [{ payload: msg.payload.buffer.readInt16LE(0,2)},\n{ payload: msg.payload.buffer.readInt16BE(0,2) }];",
        "outputs": "2",
        "noerr": 0,
        "x": 410,
        "y": 1700,
        "wires": [
            [
                "5cd727ab.845578"
            ],
            [
                "5cd727ab.845578"
            ]
        ]
    },
    {
        "id": "e7d7b528.ca82e8",
        "type": "modbus-response",
        "z": "849ecf81.3ac91",
        "name": "",
        "registerShowMax": 20,
        "x": 730,
        "y": 1620,
        "wires": []
    },
    {
        "id": "5ba934bc.4d7aec",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 410,
        "y": 1600,
        "wires": []
    },
    {
        "id": "5cd727ab.845578",
        "type": "debug",
        "z": "849ecf81.3ac91",
        "name": "",
        "active": false,
        "console": "false",
        "complete": "false",
        "x": 620,
        "y": 1700,
        "wires": []
    },
    {
        "id": "1a1bd3e7.b5411c",
        "type": "modbus-client",
        "z": "849ecf81.3ac91",
        "name": "Local Read VServer",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "tcpHost": "127.0.0.1",
        "tcpPort": "10502",
        "serialPort": "/dev/ttyS0",
        "serialType": "RTU",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": "",
        "commandDelay": "100",
        "clientTimeout": "1000",
        "reconnectTimeout": "5000"
    },
    {
        "id": "8a533609.cbd2b8",
        "type": "modbus-client",
        "z": "",
        "name": "Local Write VServer",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "tcpHost": "127.0.0.1",
        "tcpPort": "10502",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "unit_id": 1,
        "commandDelay": 1,
        "clientTimeout": 1000,
        "reconnectTimeout": 2000
    }
]
biancode

Flow Info

created 7 months, 3 weeks ago
updated 2 months, 1 week ago

Node Types

Core
  • catch (x1)
  • debug (x21)
  • function (x13)
  • inject (x17)
Other

Tags

  • modbus
  • serial
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option