Not able to Parse DINT type data using buffer parser

I have 2 devices connected on Modbus RS485 RTU loop.
a. Device : Energy Meter : Selec make. I am reading Input Registers and Data type is FLOAT. I am able to Parse this sucessfully.
b. Device : Temp Controller : Selec Make, Data sheet enclosed. As per data sheet, I should get process value at address 30007, data type is DINT.
I am able to connect and get data from Device b also, I am not able to parse the data into actual values. I am using int32 (be) and results are not as required.
When I try to get this data using MODSCAN, I am getting correct data with datay type "Integer"
Please help to get this working.
My flow is attached as below:

[
    {
        "id": "66e4f4158d59d282",
        "type": "function",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "func": "\nenergy_meter= {\n 'fc': 4, \n 'unitid': 1, \n 'address': 20, \n 'quantity': 10 \n};\n\noven2_temp= {\n 'fc': 4, \n 'unitid': 3, \n 'address': 7, \n 'quantity': 3 \n};\n\n\na = {payload:energy_meter,delay:2000};\nb = {payload:oven2_temp,delay:4000};\n\nreturn [[a], [b]];",
        "outputs": 2,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 280,
        "y": 720,
        "wires": [
            [
                "cc28d35185604bfd"
            ],
            [
                "c1547bdfda82c3bc"
            ]
        ]
    },
    {
        "id": "27dc9d110d92d47a",
        "type": "inject",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "5",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 110,
        "y": 720,
        "wires": [
            [
                "66e4f4158d59d282"
            ]
        ]
    },
    {
        "id": "cc28d35185604bfd",
        "type": "delay",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "pauseType": "delayv",
        "timeout": "500",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "outputs": 1,
        "x": 440,
        "y": 680,
        "wires": [
            [
                "5c81e7510c607d0a"
            ]
        ]
    },
    {
        "id": "c1547bdfda82c3bc",
        "type": "delay",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "pauseType": "delayv",
        "timeout": "500",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "outputs": 1,
        "x": 440,
        "y": 740,
        "wires": [
            [
                "1d54e2682f86d988"
            ]
        ]
    },
    {
        "id": "5c81e7510c607d0a",
        "type": "modbus-flex-getter",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "a9a14316b0583d1e",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 650,
        "y": 680,
        "wires": [
            [
                "8119e56070bb590f"
            ],
            []
        ]
    },
    {
        "id": "1d54e2682f86d988",
        "type": "modbus-flex-getter",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "showStatusActivities": false,
        "showErrors": false,
        "logIOActivities": false,
        "server": "a9a14316b0583d1e",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "keepMsgProperties": false,
        "x": 630,
        "y": 740,
        "wires": [
            [
                "b47b99b4d322143c"
            ],
            []
        ]
    },
    {
        "id": "086351471ddf6179",
        "type": "debug",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1210,
        "y": 680,
        "wires": []
    },
    {
        "id": "a2f79215e9e52fac",
        "type": "debug",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1210,
        "y": 740,
        "wires": []
    },
    {
        "id": "4a69db0ca81d210a",
        "type": "buffer-parser",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "int32be",
                "name": "item2",
                "offset": 0,
                "length": 1,
                "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": true,
        "outputs": 1,
        "x": 1010,
        "y": 740,
        "wires": [
            [
                "a2f79215e9e52fac"
            ]
        ]
    },
    {
        "id": "8119e56070bb590f",
        "type": "function",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "func": "var a = msg.payload[7]\nvar b = msg.payload[8]\nmsg.payload = [a,b]\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 840,
        "y": 680,
        "wires": [
            [
                "d74a72f76f315273"
            ]
        ]
    },
    {
        "id": "d74a72f76f315273",
        "type": "buffer-parser",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "data": "payload",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "floatbe",
                "name": "item1",
                "offset": 0,
                "length": 1,
                "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": true,
        "outputs": 1,
        "x": 1030,
        "y": 680,
        "wires": [
            [
                "086351471ddf6179"
            ]
        ]
    },
    {
        "id": "b47b99b4d322143c",
        "type": "function",
        "z": "578e5348ccc7cdd5",
        "name": "",
        "func": "var a = msg.payload[0]\nvar b = msg.payload[1]\nmsg.payload = [a,b]\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 840,
        "y": 740,
        "wires": [
            [
                "4a69db0ca81d210a"
            ]
        ]
    },
    {
        "id": "a9a14316b0583d1e",
        "type": "modbus-client",
        "name": "",
        "clienttype": "serial",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "tcpHost": "127.0.0.1",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB0",
        "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
    }
]

image

Red circled is output from device b (temp. controller) which is not OK. Blue circled is output from energy meter - Frequency and is OK.

Selec data sheet snip is also enclosed below:

please support.

As no one here will have access to your modbus device it is fairly pointless posting a flow with modbus nodes in. Instead, please attach a debug node (set to output full msg) to your flow & capture a sample of modbus data to us to use in an inject node (to simulate your device)

Along with that capture, tell use the value you expect to see so we can know if we are on the right track.
Lastly, does the manual state how a signed DINT is composed? Some device manufactures have a table saying things like: "signed DINT" = 4 Byte UNSIGNED INTEGER / 100 . Other might say "signed DINT" = ieee754 single precision 32-bit etc.

Thanks Steve for your reply. As I was working on this trough out the night even after posting in this forum, I have found that data from Modbus node was being received at different address than specified by supplier. When I corrected that, I found that I was able to get the desired values.
Yes, I can realize that Modbus node will not be sufficient, so I added few snips from the debug node output as picture in the topic. :slightly_smiling_face: Anyway Thanks again !!

1 Like

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