RS485 Modbus RTU slave to Modbus RTU master data converter

Hi there,

I have a wish on a RS485, 9600 baud Modbus RTU communication Line between a DCS master and a Flowmeter slave with a Node-Red programmed Pi-unit in between to do a conversion of the integer data transfered from the Flowmeter slave. Thus the Pi-unit needs to be programmed for Modbus master towards the Flowmeter slave and as Modbus slave towards the DCS master.

With Node-Red I have set up a perfectly well functioning Modbus RTU master towards the Flowmeter slave, but I struggle to set up the Node-Red to be the modbus slave for the DCS master.

I hope, I have missed a modbus slave setup for a COM-port somewhere in the fine node-red-contrib-modbus library, but have I?
Is the only Node-Red way to handle a RS485 COM Modbus slave at a Pi-unit through the ‘serial in’ and ‘serial out’ nodes, and do the portocol handling this way?

Thanks from here

What you are trying to do is to setup a modbus server. I believe you need to use one of the two modbus server nodes in the contrib package. You will need to look at what they do to see which you want. I have not used them.

Thank you Collin,

I do not however succeed in setting up a Modbus Server for COM-ports. What I have done so far however is setting up serial COM ports with a Modbus RTU master simulator and a Modbus RTU slave simulator. Further by utilising the Buffer-parser I have managed to unpack the telegram and scaled the IL to Integers. Based on what is happening in the cmd window however, I fear that I have reached some limitations at the Buffer-parser ... ? Further I still need to find out how to convert the 'join'ed msg.payload to HEX ....


Node-Red v. 16.18.0, 8.19.2

[
    {
        "id": "a15a28b62ea550b2",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "5d95f4aad9cd48b5",
        "type": "serial in",
        "z": "a15a28b62ea550b2",
        "name": "COM3, Telegram in from DCS master",
        "serial": "db3b1ab9b6af6442",
        "x": 470,
        "y": 60,
        "wires": [
            [
                "08ef1387de81334c",
                "d0e74082b39bc858"
            ]
        ]
    },
    {
        "id": "08ef1387de81334c",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Message in from master",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 830,
        "y": 60,
        "wires": []
    },
    {
        "id": "d0e74082b39bc858",
        "type": "serial out",
        "z": "a15a28b62ea550b2",
        "name": "COM4, Telegram out to slave",
        "serial": "5641689d498f1603",
        "x": 840,
        "y": 100,
        "wires": []
    },
    {
        "id": "2c651f999617b659",
        "type": "serial in",
        "z": "a15a28b62ea550b2",
        "name": "COM4, Reply in from slave",
        "serial": "5641689d498f1603",
        "x": 130,
        "y": 160,
        "wires": [
            [
                "55bf07c3e4f827a7",
                "11f9ddfd34808758",
                "1ec6a3b3fd52a0e3"
            ]
        ]
    },
    {
        "id": "55bf07c3e4f827a7",
        "type": "modbus-response",
        "z": "a15a28b62ea550b2",
        "name": "Data from slave",
        "registerShowMax": 20,
        "x": 500,
        "y": 200,
        "wires": []
    },
    {
        "id": "88e18d22185fbcc7",
        "type": "serial out",
        "z": "a15a28b62ea550b2",
        "name": "COM3, Telegram reply to master",
        "serial": "db3b1ab9b6af6442",
        "x": 1290,
        "y": 940,
        "wires": []
    },
    {
        "id": "d533814b275601b2",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Function Code",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 600,
        "y": 260,
        "wires": []
    },
    {
        "id": "98538165cd7345d8",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Byte Count",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 850,
        "y": 260,
        "wires": []
    },
    {
        "id": "f0cc671661706d38",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Sound Speed",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1300,
        "y": 240,
        "wires": []
    },
    {
        "id": "b0e96c78ddd0b931",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Density / Molweight",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1310,
        "y": 280,
        "wires": []
    },
    {
        "id": "3f2dd82772369da5",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Signal Strength Downstream",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1340,
        "y": 360,
        "wires": []
    },
    {
        "id": "7c81cb774c12759a",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Signal Strength Upstream",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1330,
        "y": 320,
        "wires": []
    },
    {
        "id": "64a5784558b23b7d",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Slave side receives Master telegram",
        "info": "",
        "x": 160,
        "y": 60,
        "wires": []
    },
    {
        "id": "0144335ea6f96344",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Telegram is passed on to Slave node",
        "info": "",
        "x": 960,
        "y": 140,
        "wires": []
    },
    {
        "id": "3a6e133b020d579d",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Slave side replies the master telegram",
        "info": "",
        "x": 170,
        "y": 120,
        "wires": []
    },
    {
        "id": "abb4c49175fb3e25",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Temperature",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1290,
        "y": 400,
        "wires": []
    },
    {
        "id": "eeded8642c99be63",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Pressure",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1280,
        "y": 440,
        "wires": []
    },
    {
        "id": "b541163c482e7dc5",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Signal Quality Up",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1310,
        "y": 480,
        "wires": []
    },
    {
        "id": "f7f816cbfaeb53e7",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Signal Quality Down",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1320,
        "y": 520,
        "wires": []
    },
    {
        "id": "2335999d379bcfee",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Checksum",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 150,
        "y": 460,
        "wires": []
    },
    {
        "id": "f9dd7df8fc8c9443",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "debug 4",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 740,
        "y": 1200,
        "wires": []
    },
    {
        "id": "edf0b29e41b1f592",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 480,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "0c2141cb5a905c7c",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 560,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "54d339c238f4c791",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 640,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "9e9b2b81ee52290b",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 720,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "e6dd879ffbbd09a6",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 800,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "806de761f8a8b140",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 880,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "11f9ddfd34808758",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "debug 5",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 480,
        "y": 160,
        "wires": []
    },
    {
        "id": "1787016422f7a7d3",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 960,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "450615a4c9b105c1",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 1040,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "901485db62a812a6",
        "type": "inject",
        "z": "a15a28b62ea550b2",
        "name": "Master Buffer FC3 one reg",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[\"0x01\", \"0x03\", \"0x00\", \"0x00\", \"0x00\", \"0x01\"]",
        "payloadType": "bin",
        "x": 150,
        "y": 1160,
        "wires": [
            [
                "c2fd80af594f1b53"
            ]
        ]
    },
    {
        "id": "c2fd80af594f1b53",
        "type": "modbus-crc16",
        "z": "a15a28b62ea550b2",
        "name": "",
        "x": 540,
        "y": 1200,
        "wires": [
            [
                "f9dd7df8fc8c9443"
            ]
        ]
    },
    {
        "id": "09850adb08e3e2e8",
        "type": "inject",
        "z": "a15a28b62ea550b2",
        "name": "Master Buffer FC3 16 reg",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "[\"0x01\", \"0x03\", \"0x20\", \"0x18\", \"0x18\", \"0x1A\", \"0x1A\", \"0x1C\", \"0x1C\", \"0x1E\", \"0x1E\", \"0x20\", \"0x20\", \"0x22\", \"0x22\", \"0x24\", \"0x24\", \"0x26\", \"0x26\", \"0x28\", \"0x28\", \"0x2A\", \"0x2A\", \"0x2C\", \"0x2C\", \"0x2E\", \"0x2E\", \"0x30\", \"0x30\", \"0x32\", \"0x32\", \"0x34\", \"0x34\", \"0x36\", \"0x36\"]",
        "payloadType": "bin",
        "x": 150,
        "y": 1220,
        "wires": [
            [
                "c2fd80af594f1b53"
            ]
        ]
    },
    {
        "id": "3d4ed4ca5741b165",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "debug 7",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1100,
        "y": 560,
        "wires": []
    },
    {
        "id": "6f1af7e7aa8a41c9",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "debug 9",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 1220,
        "y": 860,
        "wires": []
    },
    {
        "id": "d1e3a3a95acd1cab",
        "type": "modbus-crc16",
        "z": "a15a28b62ea550b2",
        "name": "",
        "x": 960,
        "y": 940,
        "wires": [
            [
                "6f1af7e7aa8a41c9",
                "88e18d22185fbcc7"
            ]
        ]
    },
    {
        "id": "8f7d30378da6648a",
        "type": "join",
        "z": "a15a28b62ea550b2",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "19",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "bin",
        "reduceFixup": "",
        "x": 930,
        "y": 560,
        "wires": [
            [
                "3d4ed4ca5741b165",
                "d1e3a3a95acd1cab"
            ]
        ]
    },
    {
        "id": "1ec6a3b3fd52a0e3",
        "type": "buffer-parser",
        "z": "a15a28b62ea550b2",
        "name": "Message in from slave",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint8",
                "name": "Node no",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint8",
                "name": "Function Code",
                "offset": 1,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint8",
                "name": "Byte Count",
                "offset": 2,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Sound Speed",
                "offset": 3,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Density / Mol weight",
                "offset": 7,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Signal Strength Upstream",
                "offset": 11,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Signal Strength Downstream",
                "offset": 15,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Temperature",
                "offset": 19,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "int32be",
                "name": "Pressure",
                "offset": 23,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "floatbe",
                "name": "Signal Quality Up",
                "offset": 27,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "floatbe",
                "name": "Signal Quality Down",
                "offset": 31,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "hex",
                "name": "CRC16",
                "offset": 35,
                "length": 4,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "value",
        "resultTypeType": "return",
        "multipleResult": true,
        "fanOutMultipleResult": true,
        "setTopic": false,
        "outputs": 12,
        "x": 180,
        "y": 340,
        "wires": [
            [
                "77e6ce53b0300e0b",
                "8f7d30378da6648a"
            ],
            [
                "d533814b275601b2",
                "8f7d30378da6648a"
            ],
            [
                "98538165cd7345d8",
                "8f7d30378da6648a"
            ],
            [
                "f0cc671661706d38",
                "edf0b29e41b1f592",
                "4a3ce1d99135a04d"
            ],
            [
                "b0e96c78ddd0b931",
                "0c2141cb5a905c7c",
                "6bcee0cbaca1cdf2"
            ],
            [
                "7c81cb774c12759a",
                "54d339c238f4c791",
                "aa7c6a508a0f1338"
            ],
            [
                "3f2dd82772369da5",
                "9e9b2b81ee52290b",
                "c955d6cfff099dd0"
            ],
            [
                "abb4c49175fb3e25",
                "e6dd879ffbbd09a6",
                "afe98f6846e60796"
            ],
            [
                "eeded8642c99be63",
                "806de761f8a8b140",
                "540ba34a8766de1b"
            ],
            [
                "b541163c482e7dc5",
                "1787016422f7a7d3",
                "1cf54e09c45cf02b"
            ],
            [
                "f7f816cbfaeb53e7",
                "450615a4c9b105c1",
                "5cc1133d74036778"
            ],
            [
                "2335999d379bcfee"
            ]
        ]
    },
    {
        "id": "77e6ce53b0300e0b",
        "type": "debug",
        "z": "a15a28b62ea550b2",
        "name": "Node no",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 400,
        "y": 260,
        "wires": []
    },
    {
        "id": "4a3ce1d99135a04d",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 520,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "6bcee0cbaca1cdf2",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 600,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "aa7c6a508a0f1338",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 680,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "c955d6cfff099dd0",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 760,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "afe98f6846e60796",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 840,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "540ba34a8766de1b",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 920,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "1cf54e09c45cf02b",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 1000,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "5cc1133d74036778",
        "type": "range",
        "z": "a15a28b62ea550b2",
        "minin": "-2147483648",
        "maxin": "2147483647",
        "minout": "-32768",
        "maxout": "32767",
        "action": "clamp",
        "round": true,
        "property": "payload",
        "name": "Scale IL to Integer",
        "x": 550,
        "y": 1080,
        "wires": [
            [
                "8f7d30378da6648a"
            ]
        ]
    },
    {
        "id": "98e25a8d1a82b780",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Fan out of slave variables",
        "info": "",
        "x": 190,
        "y": 520,
        "wires": []
    },
    {
        "id": "66359a082b308779",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Rescaling variables",
        "info": "",
        "x": 550,
        "y": 1120,
        "wires": []
    },
    {
        "id": "5fa82388e26359b7",
        "type": "comment",
        "z": "a15a28b62ea550b2",
        "name": "Modbus TCP scaled variables",
        "info": "",
        "x": 1340,
        "y": 560,
        "wires": []
    },
    {
        "id": "db3b1ab9b6af6442",
        "type": "serial-port",
        "serialport": "COM3",
        "serialbaud": "9600",
        "databits": "8",
        "parity": "even",
        "stopbits": "1",
        "waitfor": "",
        "dtr": "none",
        "rts": "none",
        "cts": "none",
        "dsr": "none",
        "newline": "50",
        "bin": "bin",
        "out": "interbyte",
        "addchar": "",
        "responsetimeout": "10000"
    },
    {
        "id": "5641689d498f1603",
        "type": "serial-port",
        "serialport": "COM4",
        "serialbaud": "9600",
        "databits": "8",
        "parity": "even",
        "stopbits": "1",
        "waitfor": "",
        "dtr": "none",
        "rts": "none",
        "cts": "none",
        "dsr": "none",
        "newline": "100",
        "bin": "bin",
        "out": "interbyte",
        "addchar": "",
        "responsetimeout": "10000"
    }
]

Is there any opportunity to switch to an ethernet based fieldbus for connection to your DCS? Are you strictly limited to serial? What controller are you using?

Hi gemini86,

Thank you for your question.
The present possibility with existing infrastructure is an old Modbus RTU master with 16-bit Integer data communication towards Modbus RTU slave with Integer Long and Float data communication.

Unfortunately no other fieldbuses can be offered.

Regards
Chris

Well that's unfortunate but I've been there. This isn't something that you're going to be able to do over node-red. Not without switching to modbus TCP because there's no known library for modbus RTU in server mode. (kindof odd). There are a few for arduino, if you must go the cheap DIY route, but I think this is something for professional use, so you're best calling either Red Lion or Advantech. I've used both before in production. (Both famous for serial protocol converters)

Hi gemini86,

most likely my programming could have been optimized, but in this case the application works:

I am fascinated about the possibilites with Node-Red, but I am still wondering about the timing in the execution of the program, since I have been struggeling a bit in getting the right values in the right format into the buffers at the right time.

I think I see what's happening there. The order of the individual registers is getting scrambled? I don't know what that big blue node is, so I can't speculate but if it's a function node that's shooting off each chunk to a different output, this is your problem. I would split the modbus word up and process each chunk serially to ensure they hit the join node in the same order that they were split.

Look at what the "split" node does and how it manages to join them back the same way they were split.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.