Convert Modbus RTU To Modbus TCP

I wanna know if it's possible to turn modbus RTU to modbus tcp

Pretty much anything is possible. But for assistance, you will need to provide more information.

Are you creating a modbus server? Wanting to accept serial connection and pass it straight out to a modbus TCP server? Something else?

I have DataKom that can be read via modbus RTU and i want to convert the data read to modbus TCP To my laptop.

WITH, Node-red on my raspberry pi

Still unclear. Will the pi connect serially and permit another modbus client to access the DataKom? Is the DataKom a master/client or slave/server?

What will the modbus TCP be? master/client or slave/server?

How are devices connected?

DataKom > Slave
Raspberry Pi > Master/Converter
My Laptop > Receiver

Can you explain why you want to do that?

My Project's are about managing incoming voltage in a home. DataKom was my solution. I handled the rest but I want to convert RTU to TCP, because incoming voltage is gonna be displayed in a Simens Green Series Display, It only has TCP.

Your explanations are still unclear. Not many here will know what a DataKom is nor what a green screen display is.

What will connect to what and what protocols do each device have..

You said DataKom was a client but what about the rest of the pieces of this puzzle?

Also, what have you achieved so far? Have you managed to connect to this DataKom device? Can you read the values?

Have yo connected the screen to node-red? Can you send data to the screen (or can the screen read from node-red)?

Lastly, does the screen support other protocols?

I was able to read “ALL OF THE DATAS” from RTU. But since the projects to read all datas from MODBUS TCP With raspberry pi, I am unsure what nodes to connect to each other to convert data from Modbus RTU to Modbus TCP.

That is why I asked the questions above.

If you answer them then we would have a better idea for you.

I tested by reading Holding regsiter data by using "Modbus Read Node" which can be your serial device. and writing by using "Modbus Write Node" and passing this to "Modbus Server" which is giving modbus data over TCP at port as specified in Modbus Server. Please see attached flow.

[
    {
        "id": "7ad6a2ac79deb9e9",
        "type": "modbus-read",
        "z": "74de3ec4.23087",
        "name": "Hold_reg3",
        "topic": "",
        "showStatusActivities": true,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "HoldingRegister",
        "adr": "0",
        "quantity": "16",
        "rate": "1",
        "rateUnit": "s",
        "delayOnStart": false,
        "startDelayTime": "",
        "server": "d3f6a446.e8ec78",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 120,
        "y": 3560,
        "wires": [
            [
                "aae548568a58e734"
            ],
            []
        ]
    },
    {
        "id": "aae548568a58e734",
        "type": "modbus-write",
        "z": "74de3ec4.23087",
        "name": "",
        "showStatusActivities": true,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "1",
        "dataType": "MHoldingRegisters",
        "adr": "0",
        "quantity": "16",
        "server": "61cb1a5ba65cc327",
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "delayOnStart": false,
        "startDelayTime": "",
        "x": 320,
        "y": 3540,
        "wires": [
            [
                "67325fa815e96b2c"
            ],
            []
        ]
    },
    {
        "id": "67325fa815e96b2c",
        "type": "modbus-server",
        "z": "74de3ec4.23087",
        "name": "",
        "logEnabled": false,
        "hostname": "127.0.0.1",
        "serverPort": 10502,
        "responseDelay": 100,
        "delayUnit": "ms",
        "coilsBufferSize": 10000,
        "holdingBufferSize": 10000,
        "inputBufferSize": 10000,
        "discreteBufferSize": 10000,
        "showErrors": false,
        "x": 540,
        "y": 3540,
        "wires": [
            [
                "465ba498d477d698"
            ],
            [],
            [],
            [],
            []
        ]
    },
    {
        "id": "465ba498d477d698",
        "type": "debug",
        "z": "74de3ec4.23087",
        "name": "debug 165",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 770,
        "y": 3520,
        "wires": []
    },
    {
        "id": "d3f6a446.e8ec78",
        "type": "modbus-client",
        "name": "test",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "127.0.0.1",
        "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": "61cb1a5ba65cc327",
        "type": "modbus-client",
        "name": "",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": true,
        "tcpHost": "127.0.0.1",
        "tcpPort": "10502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "0x3A",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "1000",
        "reconnectOnTimeout": true,
        "reconnectTimeout": "2000",
        "parallelUnitIdsAllowed": true,
        "showWarnings": true,
        "showLogs": true
    }
]

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