# Concatenate 2 hex buffer and convert

**URL:** https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980
**Category:** General
**Created:** [30 October 2021 15:15 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980 "2021-10-30T15:15:10Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![bolfox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bolfox/32/50237_2.png) [@bolfox](https://discourse.nodered.org/u/bolfox)
#### Post date: [30 October 2021 15:15 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/1 "2021-10-30T15:15:10Z")

</div>

Hi to all,

i need to concatenate 2 buffer (first 2, knx.rawValue[0] and knx.rawValue[a]) in hex like 0x08 + 0xcd, take 08+cd -\> 08cd and convert to decimal

08cd = 2253 then add a , after the first 3 digit to receive a 225,3 Volt

If necessary i have alredy the two buffer knx.rawValue[0] and knx.rawValue[1] separated.

Tnx for the help

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

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [30 October 2021 15:40 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/2 "2021-10-30T15:40:01Z")

</div>

You only have one Buffer, it is in `msg.knx.rawValue` and it is 12 bytes long.  
Have a look at node-red-contrib-buffer-parser, it is designed for exactly these problems.

---

<div class="post-metadata">

### Author: ![bolfox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bolfox/32/50237_2.png) [@bolfox](https://discourse.nodered.org/u/bolfox)
#### Post date: [30 October 2021 15:49 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/3 "2021-10-30T15:49:56Z")

</div>

> [@Colin](#):
>
> msg.knx.rawValue

Tnx, i'm alredy trying it, but how to select the buffer string 1+2 or 5+6?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [30 October 2021 17:07 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/4 "2021-10-30T17:07:53Z")

</div>

> [@bolfox](#):
>
> but how to select the buffer string 1+2 or 5+6

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

---

<div class="post-metadata">

### Author: ![bolfox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bolfox/32/50237_2.png) [@bolfox](https://discourse.nodered.org/u/bolfox)
#### Post date: [31 October 2021 07:00 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/5 "2021-10-31T07:00:06Z")

</div>

Tnx Steve for all your clarification, now i can try to decode all the message.

If i put the /10 as your example it works one time and one not, if i leave 1 it works always.

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

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [31 October 2021 07:16 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/6 "2021-10-31T07:16:32Z")

</div>

Can you set debug node to show complete message. Also and another debug set to show complete message **before** the buffer parser node. Have a look at the data in the msg when it fails. Is there anything different or odd?

---

<div class="post-metadata">

### Author: ![bolfox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bolfox/32/50237_2.png) [@bolfox](https://discourse.nodered.org/u/bolfox)
#### Post date: [31 October 2021 08:43 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/7 "2021-10-31T08:43:15Z")

</div>

After the parser WORKING

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/6/96597349e9d0a8ce098ca726b09dfe75033d1fb6.png)  
Before the parser  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc4303426c3f7347a4355c609e9d60fb809ff6fc.png)

After the parser NOT WORKING  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/6/269ae5a8e94571a354694407850fce6d7f9e3c4d.png)  
Before the parser when NOT WORKING

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

---

<div class="post-metadata">

### Author: ![bolfox](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bolfox/32/50237_2.png) [@bolfox](https://discourse.nodered.org/u/bolfox)
#### Post date: [31 October 2021 09:32 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/8 "2021-10-31T09:32:45Z")

</div>

Ok, find the problem

With scale /10 it works 1 time 1 time no, with scale 0.1 it works always

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [14 November 2021 09:32 UTC](https://discourse.nodered.org/t/concatenate-2-hex-buffer-and-convert/52980/9 "2021-11-14T09:32:53Z")

</div>

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