# From buffer-parser to values

**URL:** https://discourse.nodered.org/t/from-buffer-parser-to-values/81575
**Category:** General
**Tags:** modbus
**Created:** [25 September 2023 15:53 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575 "2023-09-25T15:53:37Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 15:53 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/1 "2023-09-25T15:53:37Z")

</div>

Hi together,  
beeing a novice in Node-Red, I kindly ask for support in my first steps.

I managed to connect to a "modbus source" (KSEM), getting power injected to grid (middle) and received (top). Now I like to add both values to a single one ?

For two single values I got an example. However how do I get the values from debug6 and debug4 into the inject node (replacing "20 and "1").

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/0/b0803966ef0c12a0686736854acc4ec58593b99c.jpeg)

Any help is welcome !  
Thanks

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 September 2023 15:55 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/2 "2023-09-25T15:55:39Z")

</div>

Hi, welcome to the forum. Sorry, I can't help with the question but I've posted in the image for you and changed the category and tag to help people understand it better.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 September 2023 16:00 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/3 "2023-09-25T16:00:49Z")

</div>

> [@Wolfe](#):
>
> For two single values I got an example. However how do I get the values from debug6 and debug4 into the inject node (replacing "20 and "1").

Oh, actually, I may be able to help.

Node-RED is flow-based so if you want to combine values, the best thing is to make gathering the data all part of one connected set of nodes. Not sure what the orange nodes are here but it looks like they can't be combined which makes things a little harder.

So to achieve it with your setup, I think you will need to write both values separately to a common flow variable. You can use the change node to do that. So have a startup flow that creates a variable object that can hold 2 values (an array or an object). Then the 2 start nodes you have there will feed into that.

Give me a couple of minutes to set up an example.

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 September 2023 16:14 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/4 "2023-09-25T16:14:00Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d01181c05d10ee33ffdb521613f881274efd37df.png)

```auto
[{"id":"0aeff87d60a98cf7","type":"inject","z":"30fdd9a9702231b0","name":"Value 1","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$formatInteger($random() * 100, \"0\")\t","payloadType":"jsonata","x":210,"y":2540,"wires":[["632d4fea7987727c"]]},{"id":"edc4413835772881","type":"inject","z":"30fdd9a9702231b0","name":"Value 2","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"$formatInteger($random() * 100, \"0\")","payloadType":"jsonata","x":210,"y":2660,"wires":[["edfa815baf56347f"]]},{"id":"632d4fea7987727c","type":"change","z":"30fdd9a9702231b0","name":"","rules":[{"t":"set","p":"mystore.val1","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":2540,"wires":[["5ae39ea11d0ee939","49ad6404c0697e19"]]},{"id":"edfa815baf56347f","type":"change","z":"30fdd9a9702231b0","name":"","rules":[{"t":"set","p":"mystore.val2","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":2660,"wires":[["6eb6c5410fbdc835","cae0f290505b378d"]]},{"id":"5ae39ea11d0ee939","type":"debug","z":"30fdd9a9702231b0","name":"payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":2540,"wires":[]},{"id":"6eb6c5410fbdc835","type":"debug","z":"30fdd9a9702231b0","name":"flow.mystore","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"$flowContext(\"mystore\")\t","targetType":"jsonata","statusVal":"","statusType":"auto","x":690,"y":2700,"wires":[]},{"id":"49ad6404c0697e19","type":"debug","z":"30fdd9a9702231b0","name":"flow.mystore","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"$flowContext(\"mystore\")\t","targetType":"jsonata","statusVal":"","statusType":"auto","x":690,"y":2580,"wires":[]},{"id":"cae0f290505b378d","type":"debug","z":"30fdd9a9702231b0","name":"payload","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":680,"y":2660,"wires":[]}]

```

Note that, at the point of receipt of one of the values, the other value may still have a previous figure. This may or may not be an issue for you. Things get a lot more complex if you have to coordinate both values to have had updates before you use/show them.

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 16:29 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/5 "2023-09-25T16:29:12Z")

</div>

Hi thanks for help.

However the input comes via Modbus: P-Bezug and P-Einsp., resp. debug6 and debug4.

I tried to sketch it as follows:

 ![Sketch to illustrate](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35bd9e986820a88e0362318a683b1302f054cb54.jpeg)

Both values "P-Bezug" and "P-Einsp." are synchronized.

How can I upload my Node-Red "Flow" export ?

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 16:46 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/6 "2023-09-25T16:46:27Z")

</div>

You would normally just wire from the buffer parser to the change nodes and not use inject nodes. why do you ant to use inject nodes, do you require some timer or repeat function the inject nodes offer. If so you might want to look a the cron plus node. If you want them in the same message you would normally join them.

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:00 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/7 "2023-09-25T17:00:40Z")

</div>

The inject nodes needs to be replaced, they are just used to test the sum-function.

I assume, just to "wire from parser to change nodes" isn't that easy:

 ![2023-09-25 18.58 2457](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/a/ea419450d1729285bf222a7e79c330aaacbc2535.jpeg)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 17:05 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/8 "2023-09-25T17:05:39Z")

</div>

Please post your flow, and debug 4 and 6 values in text format.

[How to import/export a flow](https://nodered.org/docs/user-guide/editor/workspace/import-export)

There’s a great page in the docs ([Working with messages : Node-RED](https://nodered.org/docs/user-guide/messages)) that will explain how to use the debug panel to find the right path/value to any data item.

Pay particular attention to the part about the buttons that appear under your mouse pointer when you over hover a debug message property in the sidebar.

![BX00Cy7yHi](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/d/bd1f333a9e043b061b39917c328b0094d3e52d30.gif)

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

I will then look at the jsonata expressionyou have used

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:15 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/10 "2023-09-25T17:15:12Z")

</div>

```auto
[
    {
        "id": "03a396edb292a231",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "53ab8c795075ebaf",
        "type": "modbus-read",
        "z": "03a396edb292a231",
        "name": "P-Einsp.",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "2",
        "quantity": "2",
        "rate": "5",
        "rateUnit": "s",
        "delayOnStart": true,
        "startDelayTime": "10",
        "server": "cc73dd7ed0ec7878",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 140,
        "y": 380,
        "wires": [
            [
                "a487c9c347817d2f"
            ],
            [
                "4dc5b84a160a51b6"
            ]
        ]
    },
    {
        "id": "a487c9c347817d2f",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 3",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 380,
        "wires": []
    },
    {
        "id": "4dc5b84a160a51b6",
        "type": "buffer-parser",
        "z": "03a396edb292a231",
        "name": "",
        "data": "payload.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint32le",
                "name": "temp1",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint32be",
                "name": "temp2",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 170,
        "y": 460,
        "wires": [
            [
                "9ff9a27c6cd822a3",
                "96c90e44ff4480de"
            ]
        ]
    },
    {
        "id": "9ff9a27c6cd822a3",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 460,
        "wires": []
    },
    {
        "id": "2685cdde1ffd9c43",
        "type": "modbus-read",
        "z": "03a396edb292a231",
        "name": "P-Bezug",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "0",
        "quantity": "2",
        "rate": "5",
        "rateUnit": "s",
        "delayOnStart": true,
        "startDelayTime": "10",
        "server": "cc73dd7ed0ec7878",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 140,
        "y": 160,
        "wires": [
            [
                "271b7f1fa6a4e276"
            ],
            [
                "3368288c707c0745"
            ]
        ]
    },
    {
        "id": "271b7f1fa6a4e276",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 5",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 160,
        "wires": []
    },
    {
        "id": "3368288c707c0745",
        "type": "buffer-parser",
        "z": "03a396edb292a231",
        "name": "",
        "data": "payload.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "int32be",
                "name": "temp3",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint32le",
                "name": "temp4",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 170,
        "y": 220,
        "wires": [
            [
                "889e8f826cbe539f"
            ]
        ]
    },
    {
        "id": "889e8f826cbe539f",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 6",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 220,
        "wires": []
    },
    {
        "id": "364362509034c10f",
        "type": "inject",
        "z": "03a396edb292a231",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "20",
        "payloadType": "num",
        "x": 110,
        "y": 540,
        "wires": [
            [
                "6689ad89631f9faf"
            ]
        ]
    },
    {
        "id": "282b88cfcc391588",
        "type": "join",
        "z": "03a396edb292a231",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "num",
        "reduceFixup": "",
        "x": 450,
        "y": 540,
        "wires": [
            [
                "71304130f6d73719"
            ]
        ]
    },
    {
        "id": "6689ad89631f9faf",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "parts",
                "pt": "msg",
                "to": "1",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 540,
        "wires": [
            [
                "282b88cfcc391588"
            ]
        ]
    },
    {
        "id": "96c90e44ff4480de",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "parts",
                "pt": "msg",
                "to": "2",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 580,
        "wires": [
            [
                "282b88cfcc391588"
            ]
        ]
    },
    {
        "id": "71304130f6d73719",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "$sum(payload)",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$sum(payload)",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 620,
        "y": 540,
        "wires": [
            [
                "2082de158de1720e"
            ]
        ]
    },
    {
        "id": "2082de158de1720e",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 830,
        "y": 540,
        "wires": []
    },
    {
        "id": "cc73dd7ed0ec7878",
        "type": "modbus-client",
        "name": "KSEM",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": true,
        "tcpHost": "192.168.178.61",
        "tcpPort": "502",
        "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
    }
]

```

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:17 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/11 "2023-09-25T17:17:32Z")

</div>

Sorry my headline looks like this:  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/d/6dde3c124a00641cbeab6cd5c267a67fd2cbb8c7.png)

The  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/5/35544bd654603bbda5f5b4f782a7a2f71353c419.png)  
tiles are missing.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 17:17 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/12 "2023-09-25T17:17:48Z")

</div>

> [@Wolfe](#):
>
> The funny thing, my head lines misses those tiles:  
> ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/a/3aaccee076b60fbbcc5178820c47cf04e4211d5f.png)

Right side icon it is an option there, some browsers layout is different.

Still require debug 4 and 6 in text format.

Do you require the sum of all 4 temps? or sum of temp1's and sum of temp2's?

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:28 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/13 "2023-09-25T17:28:29Z")

</div>

No just two: the sum of temp2 and temp3.

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 17:30 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/14 "2023-09-25T17:30:45Z")

</div>

Are you going to supply the debug data i asked for in a text format? If you want help it is only polite to supply the data required to help you.

> [@Note to new Forum members](https://discourse.nodered.org/t/note-to-new-forum-members/71295/1):
>
> How to get the most help from the Forum Many new users come here for help with an issue they are having with Node-RED. I hope no one will be offended if I offer some unsolicited advice that might help them get the help they need. Many members of this group are willing to volunteer to assist others, as long as it is recognized that their time is valuable and should be treated with respect. They will generally provide guidance and encouragement, but do not expect complete solutions or large amoun…

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:33 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/15 "2023-09-25T17:33:45Z")

</div>

I'm not that familar with the tool node-red yet.

Like this ?

{"temp3":330,"temp4":1241579520}  
{"temp1":0,"temp2":0}  
 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/8/58ed5b3927e35058a3187dec95244b774f2d79e7.png)

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 17:41 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/16 "2023-09-25T17:41:06Z")

</div>

Example of joining output and then adding 2 values.

```auto
[{"id":"364362509034c10f","type":"inject","z":"03a396edb292a231","name":"simulate bF output","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"temp3\":330,\"temp4\":1241579520}","payloadType":"json","x":170,"y":200,"wires":[["1de232ee08047294"]]},{"id":"1de232ee08047294","type":"change","z":"03a396edb292a231","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"BF1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":360,"y":200,"wires":[["282b88cfcc391588","a487c9c347817d2f"]]},{"id":"282b88cfcc391588","type":"join","z":"03a396edb292a231","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":490,"y":260,"wires":[["71304130f6d73719"]]},{"id":"a487c9c347817d2f","type":"debug","z":"03a396edb292a231","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":380,"wires":[]},{"id":"97154fb78a270292","type":"change","z":"03a396edb292a231","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"BF2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":300,"wires":[["282b88cfcc391588","9ff9a27c6cd822a3"]]},{"id":"71304130f6d73719","type":"change","z":"03a396edb292a231","name":"$sum(payload)","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload.BF1.temp3 + $$.payload.BF2.temp1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":640,"y":400,"wires":[["2082de158de1720e"]]},{"id":"a801c79f5e7717a3","type":"inject","z":"03a396edb292a231","name":"simulate BF output","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":" {\"temp1\":0,\"temp2\":0}","payloadType":"json","x":150,"y":300,"wires":[["97154fb78a270292"]]},{"id":"9ff9a27c6cd822a3","type":"debug","z":"03a396edb292a231","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":460,"wires":[]},{"id":"2082de158de1720e","type":"debug","z":"03a396edb292a231","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","statusVal":"payload","statusType":"auto","x":830,"y":540,"wires":[]}]

```

I do not have buffer parser installed so have simulated it with two injects.

p.s surround the debug info with triple backticks, using \</\> then we get a copy button, makes life easier.

I think these [essentials videos](https://m.youtube.com/watch?list=PLyNBB9VCLmo1hyO-4fIZ08gqFcXBkHy-6&v=ksGeUD26Mw0&embeds_referring_euri=https%3A%2F%2Fnodered.org%2F&source_ve_path=OTY3MTQ&feature=emb_imp_woyt) will help you understand the basics

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:41 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/17 "2023-09-25T17:41:17Z")

</div>

Now I found the tiles

```auto
[
    {
        "id": "03a396edb292a231",
        "type": "tab",
        "label": "Flow 3",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "53ab8c795075ebaf",
        "type": "modbus-read",
        "z": "03a396edb292a231",
        "name": "P-Einsp.",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "2",
        "quantity": "2",
        "rate": "5",
        "rateUnit": "s",
        "delayOnStart": true,
        "startDelayTime": "10",
        "server": "cc73dd7ed0ec7878",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 140,
        "y": 380,
        "wires": [
            [
                "a487c9c347817d2f"
            ],
            [
                "4dc5b84a160a51b6"
            ]
        ]
    },
    {
        "id": "a487c9c347817d2f",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 3",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 380,
        "wires": []
    },
    {
        "id": "4dc5b84a160a51b6",
        "type": "buffer-parser",
        "z": "03a396edb292a231",
        "name": "",
        "data": "payload.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "uint32le",
                "name": "temp1",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint32be",
                "name": "temp2",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 170,
        "y": 460,
        "wires": [
            [
                "9ff9a27c6cd822a3",
                "96c90e44ff4480de"
            ]
        ]
    },
    {
        "id": "9ff9a27c6cd822a3",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 4",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 460,
        "wires": []
    },
    {
        "id": "2685cdde1ffd9c43",
        "type": "modbus-read",
        "z": "03a396edb292a231",
        "name": "P-Bezug",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "showWarnings": true,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "0",
        "quantity": "2",
        "rate": "5",
        "rateUnit": "s",
        "delayOnStart": true,
        "startDelayTime": "10",
        "server": "cc73dd7ed0ec7878",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 140,
        "y": 160,
        "wires": [
            [
                "271b7f1fa6a4e276"
            ],
            [
                "3368288c707c0745"
            ]
        ]
    },
    {
        "id": "271b7f1fa6a4e276",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 5",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 160,
        "wires": []
    },
    {
        "id": "3368288c707c0745",
        "type": "buffer-parser",
        "z": "03a396edb292a231",
        "name": "",
        "data": "payload.buffer",
        "dataType": "msg",
        "specification": "spec",
        "specificationType": "ui",
        "items": [
            {
                "type": "int32be",
                "name": "temp3",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            },
            {
                "type": "uint32le",
                "name": "temp4",
                "offset": 0,
                "length": 1,
                "offsetbit": 0,
                "scale": "1",
                "mask": ""
            }
        ],
        "swap1": "",
        "swap2": "",
        "swap3": "",
        "swap1Type": "swap",
        "swap2Type": "swap",
        "swap3Type": "swap",
        "msgProperty": "payload",
        "msgPropertyType": "str",
        "resultType": "keyvalue",
        "resultTypeType": "return",
        "multipleResult": false,
        "fanOutMultipleResult": false,
        "setTopic": true,
        "outputs": 1,
        "x": 170,
        "y": 220,
        "wires": [
            [
                "889e8f826cbe539f"
            ]
        ]
    },
    {
        "id": "889e8f826cbe539f",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "debug 6",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 360,
        "y": 220,
        "wires": []
    },
    {
        "id": "364362509034c10f",
        "type": "inject",
        "z": "03a396edb292a231",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "20",
        "payloadType": "num",
        "x": 110,
        "y": 540,
        "wires": [
            [
                "6689ad89631f9faf"
            ]
        ]
    },
    {
        "id": "282b88cfcc391588",
        "type": "join",
        "z": "03a396edb292a231",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "2",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "num",
        "reduceFixup": "",
        "x": 450,
        "y": 540,
        "wires": [
            [
                "71304130f6d73719"
            ]
        ]
    },
    {
        "id": "6689ad89631f9faf",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "parts",
                "pt": "msg",
                "to": "1",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 540,
        "wires": [
            [
                "282b88cfcc391588"
            ]
        ]
    },
    {
        "id": "96c90e44ff4480de",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "parts",
                "pt": "msg",
                "to": "2",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 260,
        "y": 580,
        "wires": [
            [
                "282b88cfcc391588"
            ]
        ]
    },
    {
        "id": "71304130f6d73719",
        "type": "change",
        "z": "03a396edb292a231",
        "name": "$sum(payload)",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$sum(payload)",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 620,
        "y": 540,
        "wires": [
            [
                "2082de158de1720e"
            ]
        ]
    },
    {
        "id": "2082de158de1720e",
        "type": "debug",
        "z": "03a396edb292a231",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 830,
        "y": 540,
        "wires": []
    },
    {
        "id": "cc73dd7ed0ec7878",
        "type": "modbus-client",
        "name": "KSEM",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": true,
        "tcpHost": "192.168.178.61",
        "tcpPort": "502",
        "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
    }
]

```

---

<div class="post-metadata">

### Author: ![Wolfe](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/wolfe/32/108255_2.png) [@Wolfe](https://discourse.nodered.org/u/Wolfe)
#### Post date: [25 September 2023 17:55 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/18 "2023-09-25T17:55:27Z")

</div>

Thanks a lot E1cid, much appreciated.

The video I take tomorrow (loc is close to 8 pm and my wife is now back from work 😉 )

I got the message from your example, how to make an inject node using an array.

However the question remains, how I transfer values from "buffer parser" to an array ?

Tomorrow is another day

---

<div class="post-metadata">

### Author: ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)
#### Post date: [25 September 2023 17:58 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/19 "2023-09-25T17:58:29Z")

</div>

You are not understanding the inject nodes simulate the output of the buffer nodes, as i do not have them on my machine. That is why i require the text debug data so i could simulate the buffer node output.

Just delete the injects and wire the buffer nodes to the change nodes, not sure which way round, but if first try does not work reverse the wiring.

[edit] You could also join using merge and a count of 4,  
just add the buffer nodes direct to the join node  
e.g.

```auto
[{"id":"364362509034c10f","type":"inject","z":"03a396edb292a231","name":"simulate bF output","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"temp3\":330,\"temp4\":1241579520}","payloadType":"json","x":170,"y":200,"wires":[["282b88cfcc391588","a487c9c347817d2f"]]},{"id":"282b88cfcc391588","type":"join","z":"03a396edb292a231","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":490,"y":260,"wires":[["71304130f6d73719"]]},{"id":"a487c9c347817d2f","type":"debug","z":"03a396edb292a231","name":"debug 3","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":380,"wires":[]},{"id":"a801c79f5e7717a3","type":"inject","z":"03a396edb292a231","name":"simulate BF output","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":" {\"temp1\":0,\"temp2\":0}","payloadType":"json","x":150,"y":300,"wires":[["282b88cfcc391588","9ff9a27c6cd822a3"]]},{"id":"71304130f6d73719","type":"change","z":"03a396edb292a231","name":"add temp1 to temp3","rules":[{"t":"set","p":"payload","pt":"msg","to":"$$.payload.temp3 + $$.payload.temp1","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":660,"y":400,"wires":[["2082de158de1720e"]]},{"id":"9ff9a27c6cd822a3","type":"debug","z":"03a396edb292a231","name":"debug 4","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":360,"y":460,"wires":[]},{"id":"2082de158de1720e","type":"debug","z":"03a396edb292a231","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","statusVal":"payload","statusType":"auto","x":830,"y":540,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)
#### Post date: [25 September 2023 19:44 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/20 "2023-09-25T19:44:56Z")

</div>

> [@Wolfe](#):
>
> Both values "P-Bezug" and "P-Einsp." are synchronized.

I doubt they are in terms that Node-RED understands. For now assume they are not. In my example, I replaced them with manual injects so you could see how it works. Take the output either from the orange nodes or the blue nodes and feed into change nodes as in my example.

---

<div class="post-metadata">

### Author: ![craigcurtin](https://avatars.discourse-cdn.com/v4/letter/c/94ad74/32.png) [@craigcurtin](https://discourse.nodered.org/u/craigcurtin)
#### Post date: [25 September 2023 23:51 UTC](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575/21 "2023-09-25T23:51:35Z")

</div>

Can you post screenshots of what your modbus nodes are configured as ?

I would suggest you could use a different combination of nodes - for example if you see the screenshot below -

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/4/e/4e84b21c15fdd7dbd15a78de5ae0e36bcd823aeb.png)

You can see i send an inject every 10 seconds to kick the process off - it first sends a modbus request to the inverter for some information - which is returned and i then move that using the change node into another part of the message. I then do a 2nd query to that inverter (for a different set of registers) and move the results of that query into a different part of the message - here are the screenshots of each of them

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/c/fcb8d4631126a4d8957cd9e98c6f7030d7de7fb7.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/d/3dc03c04e8932446459ad8defbff09f3790ff8f3.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/3/038a6f1902260cf39cfb0d8fcc5bc12092b7d5b0.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/c/9c9d1a13b1b463cc2fe95bb3e1dcf84ef50d294f.png)

And this is what it looks like in a single message

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/d/0da93eed9303fca81962c7da0bac94f5daf60230.png)

They are no totally synchronized (in terms of both being read at the exact same moment) but for most home requirements are good enough (sub second difference)

Craig

[Next page](https://discourse.nodered.org/t/from-buffer-parser-to-values/81575.md?page=2)
