Serial String combine

Hi there.

I'm too stupid for that shit :crazy_face:

I read out the serial Interface and get every 0,01s a ASCII-String with 8 HEX Values.
Now I have to modify some of the Values because its ASCII and there is an '=' for the HEX 'D'.
No Problem...I split the string in 8 singel Values; check them to unusual Letters and rename them to the right HEX Letters.
NOW.....I have to combine them in another way. Means form "ABCDEFGH" it muss be "BADCFEHG".
But i found no way to combine! I tryed the "JOIN" Node with "Parts" in the order i will have them in the end. But some times its not in the right order.
Is there no way to put strings hard together like:" do A+B then that + C than that + E...."? :thinking:

Than i tried to solv the problem with a workarround and for that I've change the HEX values to DEC; wirte functionNodes which save 8 values in the context; and another functionNode will add them together in the right order and multiplies the 16².... to the coresponding places.
that seems to work, but only with the last 4 places. If I try to add more then 4 places it will show NaN in the Debug. Could it be, that the resault is to big to handle in Node Red?

To understand: the Value I get over the Serial is a Timer that runs up and I've to calculate with.

I try to link my function here, but its the first time and I don't know how it works, sorry for that :see_no_evil:

[{"id":"556d7788.65c408","type":"serial in","z":"71c7d63c.5979","name":"","serial":"360ef398.71e004","x":210,"y":360,"wires":[["9e6fe3a2.53b5f","7d8d4f4f.743738"]]},{"id":"9e6fe3a2.53b5f","type":"debug","z":"71c7d63c.5979","name":"Serial RAW IN","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":420,"y":200,"wires":[]},{"id":"c5f42dd5.fe25e8","type":"string","z":"71c7d63c.5979","name":"sep TIME","methods":[{"name":"left","params":[{"type":"num","value":"10"}]},{"name":"right","params":[{"type":"num","value":"8"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":540,"y":360,"wires":[["42533a2d.475e2c","382e4c56.d18504","9dc35800.3a4ef","4e973dbd.9b4adc","b1d544fd.58b53","2c882d21.dfc0b2","854c34e1.8765b8","53143278.3f41cc"]]},{"id":"50ac75e2.b793e4","type":"debug","z":"71c7d63c.5979","name":"bit to int","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2280,"y":800,"wires":[]},{"id":"7d8d4f4f.743738","type":"switch","z":"71c7d63c.5979","name":"","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"?:","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":360,"wires":[[],["c5f42dd5.fe25e8"]]},{"id":"42533a2d.475e2c","type":"string","z":"71c7d63c.5979","name":"Stelle 1","methods":[{"name":"left","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":260,"wires":[["dd85d72a.464cb8","8a614a43.a63a5"]]},{"id":"9dc35800.3a4ef","type":"string","z":"71c7d63c.5979","name":"Stelle 3","methods":[{"name":"left","params":[{"type":"num","value":"3"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":340,"wires":[["b0002429.8f8c38"]]},{"id":"4e973dbd.9b4adc","type":"string","z":"71c7d63c.5979","name":"Stelle 4","methods":[{"name":"left","params":[{"type":"num","value":"4"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":380,"wires":[["e9081ab6.f94e98"]]},{"id":"b1d544fd.58b53","type":"string","z":"71c7d63c.5979","name":"Stelle 5","methods":[{"name":"left","params":[{"type":"num","value":"5"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":420,"wires":[["e9548f8.631f57"]]},{"id":"854c34e1.8765b8","type":"string","z":"71c7d63c.5979","name":"Stelle 7","methods":[{"name":"left","params":[{"type":"num","value":"7"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":500,"wires":[["f799c808.8b88a"]]},{"id":"53143278.3f41cc","type":"string","z":"71c7d63c.5979","name":"Stelle 8","methods":[{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":540,"wires":[["ebb736b2.52a988"]]},{"id":"382e4c56.d18504","type":"string","z":"71c7d63c.5979","name":"Stelle 2","methods":[{"name":"left","params":[{"type":"num","value":"2"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":300,"wires":[["1e397951.af1457"]]},{"id":"2c882d21.dfc0b2","type":"string","z":"71c7d63c.5979","name":"Stelle 6","methods":[{"name":"left","params":[{"type":"num","value":"6"}]},{"name":"right","params":[{"type":"num","value":"1"}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":820,"y":460,"wires":[["8c755cff.818ba"]]},{"id":"dd85d72a.464cb8","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"2","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":260,"wires":[["78beb1b1.d66898","c3aaa90b.e0cc8"]]},{"id":"1e397951.af1457","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"1","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1026,"y":303,"wires":[["4e38c027.90bfd8","c3aaa90b.e0cc8"]]},{"id":"b0002429.8f8c38","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"4","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":340,"wires":[["347f76cb.e38652","c3aaa90b.e0cc8"]]},{"id":"e9081ab6.f94e98","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"3","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":380,"wires":[["8a137c8e.be83b","c3aaa90b.e0cc8"]]},{"id":"e9548f8.631f57","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"6","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1020,"y":420,"wires":[["82284f87.23b828","c3aaa90b.e0cc8"]]},{"id":"8c755cff.818ba","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"5","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":460,"wires":[["dfca92bd.3f9dd8","c3aaa90b.e0cc8"]]},{"id":"f799c808.8b88a","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"8","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":500,"wires":[["2f40f4a3.b7272c","c3aaa90b.e0cc8"]]},{"id":"ebb736b2.52a988","type":"change","z":"71c7d63c.5979","name":"ASCII to HEX","rules":[{"t":"set","p":"parts","pt":"msg","to":"7","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":":","fromt":"str","to":"A","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":";","fromt":"str","to":"B","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"<","fromt":"str","to":"C","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"=","fromt":"str","to":"D","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":">","fromt":"str","to":"E","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"?","fromt":"str","to":"F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1030,"y":540,"wires":[["b55299.6d04a568","c3aaa90b.e0cc8","e692a42d.e4fc48"]]},{"id":"fb158b78.f95a9","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":120,"wires":[["fb924f27.b9fee8"]]},{"id":"c3aaa90b.e0cc8","type":"join","z":"71c7d63c.5979","name":"","mode":"custom","build":"string","property":"payload","propertyType":"msg","key":"topic","joiner":"","joinerType":"str","accumulate":false,"timeout":"","count":"8","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1290,"y":120,"wires":[["fb158b78.f95a9"]]},{"id":"8a137c8e.be83b","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":460,"wires":[["e92e7eec.d97318","a0c78342.601038"]]},{"id":"2f40f4a3.b7272c","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1430,"y":960,"wires":[["973469cf.36a75","eaac7351.ca1b48","50ac75e2.b793e4"]]},{"id":"b55299.6d04a568","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1470,"y":740,"wires":[["a4733776.6d112","50ac75e2.b793e4","b8a01721.f6686"]]},{"id":"82284f87.23b828","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1470,"y":660,"wires":[["e3e50557.02dc18","d0c2f01c.edac28"]]},{"id":"347f76cb.e38652","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":380,"wires":[["94ead8d1.d89e98","c4ee566b.b58dd8"]]},{"id":"78beb1b1.d66898","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":260,"wires":[["cb3b1f6c.b6ba1","2673a9b1.2eadce"]]},{"id":"dfca92bd.3f9dd8","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":560,"wires":[["4b0c4b3d.fefec4","7ee47ff0.07405"]]},{"id":"4e38c027.90bfd8","type":"function","z":"71c7d63c.5979","name":"HEX To DEC","func":"msg.payload = parseInt(\"0x\"+msg.payload);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1450,"y":320,"wires":[["eb10058.8478678","27ab1030.75838"]]},{"id":"eb10058.8478678","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":1,"width":2,"height":2,"name":"","label":"1","format":"{{msg.payload}}","layout":"col-center","x":1930,"y":320,"wires":[]},{"id":"cb3b1f6c.b6ba1","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":2,"width":2,"height":2,"name":"","label":"2","format":"{{msg.payload}}","layout":"col-center","x":1930,"y":260,"wires":[]},{"id":"973469cf.36a75","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":8,"width":2,"height":2,"name":"","label":"8","format":"{{msg.payload}}","layout":"col-center","x":2130,"y":860,"wires":[]},{"id":"a4733776.6d112","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":7,"width":2,"height":2,"name":"","label":"7","format":"{{msg.payload}}","layout":"col-center","x":2110,"y":740,"wires":[]},{"id":"e3e50557.02dc18","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":6,"width":2,"height":2,"name":"","label":"6","format":"{{msg.payload}}","layout":"col-center","x":2090,"y":640,"wires":[]},{"id":"4b0c4b3d.fefec4","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":5,"width":2,"height":2,"name":"","label":"5","format":"{{msg.payload}}","layout":"col-center","x":2090,"y":560,"wires":[]},{"id":"94ead8d1.d89e98","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":4,"width":2,"height":2,"name":"","label":"4","format":"{{msg.payload}}","layout":"col-center","x":2070,"y":400,"wires":[]},{"id":"e92e7eec.d97318","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":3,"width":2,"height":2,"name":"","label":"3","format":"{{msg.payload}}","layout":"col-center","x":2070,"y":460,"wires":[]},{"id":"180ac3fc.36dea4","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\ncontext.set('Wert1',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1920,"y":360,"wires":[]},{"id":"5562b31c.c3c0bc","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\ncontext.set('Wert2',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":2060,"y":300,"wires":[]},{"id":"3bcac2e6.993aae","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\ncontext.set('Wert3',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1940,"y":500,"wires":[]},{"id":"5534b82c.9c8f18","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\ncontext.set('Wert4',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1920,"y":420,"wires":[]},{"id":"68396b4e.9b834c","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\nflow.set('wert5',pipi);\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1940,"y":600,"wires":[[]]},{"id":"eb1959ae.27e5e","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\nflow.set('wert6',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1940,"y":680,"wires":[]},{"id":"a935baa1.783bb8","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\nflow.set('wert7',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1940,"y":800,"wires":[]},{"id":"561fb112.fcdd5","type":"function","z":"71c7d63c.5979","name":"","func":"var pipi = msg.payload;\n\nflow.set('wert8',pipi);\n","outputs":0,"noerr":0,"initialize":"","finalize":"","x":1940,"y":960,"wires":[]},{"id":"8a614a43.a63a5","type":"ui_text","z":"71c7d63c.5979","group":"62998b14.613b8c","order":11,"width":8,"height":2,"name":"","label":"funtion","format":"{{msg.payload}}","layout":"col-center","x":970,"y":140,"wires":[]},{"id":"7ee47ff0.07405","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":560,"wires":[["68396b4e.9b834c"]]},{"id":"d0c2f01c.edac28","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":660,"wires":[["eb1959ae.27e5e"]]},{"id":"b8a01721.f6686","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":800,"wires":[["a935baa1.783bb8"]]},{"id":"eaac7351.ca1b48","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1720,"y":960,"wires":[["561fb112.fcdd5"]]},{"id":"c4ee566b.b58dd8","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":420,"wires":[["5534b82c.9c8f18"]]},{"id":"a0c78342.601038","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1680,"y":500,"wires":[["3bcac2e6.993aae"]]},{"id":"2673a9b1.2eadce","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":300,"wires":[["5562b31c.c3c0bc"]]},{"id":"27ab1030.75838","type":"change","z":"71c7d63c.5979","name":"","rules":[{"t":"change","p":"payload","pt":"msg","from":"","fromt":"str","to":"","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":1700,"y":360,"wires":[["180ac3fc.36dea4"]]},{"id":"e692a42d.e4fc48","type":"function","z":"71c7d63c.5979","name":"","func":"var wert_1 = flow.get(\"wert1\");\nvar wert_2 = flow.get(\"wert2\");\nvar wert_3 = flow.get(\"wert3\");\nvar wert_4 = flow.get(\"wert4\");\nvar wert_5 = flow.get(\"wert5\");\nvar wert_6 = flow.get(\"wert6\");\nvar wert_7 = flow.get(\"wert7\");\nvar wert_8 = flow.get(\"wert8\");\n\nvar kaka=wert_1*268435456 + wert_2*16777216 + wert_3*1048576 + wert_4*65536;\nvar pipi=wert_5*4096 + wert_6*256 + wert_7*16 + wert_8;\n\n\n\nmsg.payload =  kaka+pipi;\n\n\n\n\n\n\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1460,"y":180,"wires":[["fb924f27.b9fee8"]]},{"id":"fb924f27.b9fee8","type":"debug","z":"71c7d63c.5979","name":"Serial IN EDIT","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":2080,"y":100,"wires":[]},{"id":"360ef398.71e004","type":"serial-port","serialport":"COM8","serialbaud":"19200","databits":"8","parity":"none","stopbits":"1","waitfor":"","dtr":"none","rts":"none","cts":"none","dsr":"none","newline":"$","bin":"false","out":"char","addchar":"\\r","responsetimeout":"10000"},{"id":"62998b14.613b8c","type":"ui_group","name":"Standard","tab":"9a4a7cac.46693","order":1,"disp":true,"width":16,"collapse":false},{"id":"9a4a7cac.46693","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Hi. Firstly, please don't swear on the forum.

Ok, so all that byteswapping and data conversion/extraction can be nicely handled by the buffer-parser node (it's a contrib node in the library)

Hi Steve.

Sorry for that. Should be more a joke.
I've found this Node already, but it's handling was a little too complicated for me. :flushed:
Maby I trie it once more.

ALEX

no worries.

buffer-parser is a bit more complex than your average node but this is entirely due to the even more complex problems it aims to solve.

But there is extensive built in documentation and I can help (I wrote it)

1 Like

Hey.

So I tried it again.
I get for example a "000059E5" from the serail. This must be coresponding to a dec=38238. That i know.
So i think that the order is "0000955E".

I take the example "Working with bits and bools" and place only my "000059E5" in the function an when I change the parser node to something like: uint16(le) length 1 offset 0 ---- I get 23013.
That would be like a 0x000059E5.

If I write a 0x0000955E in the function and change the parsers byteswat to 16 I get a dec=38238!

But thats not my order, because i get this 0x000059E5 :hot_face:

Do you have a solution for me? :cold_sweat:

ALEX

Very odd. if your expectant value is accurate, your data is nibble swapped.

Hey ho.

[{"id":"57e4dff3.0c252","type":"inject","z":"71ef45d0.31579c","name":"fake serial data 000059E5","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"000059E5","payloadType":"str","x":1140,"y":356,"wires":[["fefbe43f.692be8"]]},{"id":"b6ab58ab.a5e6e8","type":"debug","z":"71ef45d0.31579c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.item1","statusType":"msg","x":1400,"y":416,"wires":[]},{"id":"fefbe43f.692be8","type":"function","z":"71ef45d0.31579c","name":"nibble swap","func":"msg.buffer = Buffer.from(msg.payload,\"hex\");\nfor(let i = 0; i < msg.buffer.length; i++) {\n    var b0 = msg.buffer[i];\n    msg.buffer[i] = (b0 << 4) + (b0 >> 4);\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1400,"y":356,"wires":[["5574de3a.f3189"]]},{"id":"5574de3a.f3189","type":"buffer-parser","z":"71ef45d0.31579c","name":"","data":"buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16be","name":"value","offset":2,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"buffer","name":"buffer","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"hex","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":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1190,"y":416,"wires":[["b6ab58ab.a5e6e8"]]}]

SUPER COOL! Thank you for that.

I'm sorry but I'm not so deep in the matter that I could do it by my self.

Unfortunately there is a Problem yet.

I know that a 0x00100017 musst be dec=65649. And your flow put a 113 in debug :flushed:

I think the Order is:
original from serial (only a example) 0x12345678
an for me it must be 0x21436587. Is that an idea?

And please excuse my german english :see_no_evil:

ALEX

65649 is > 16 bit max.

in other words, your value should be 32 bit...

[{"id":"95ee6e3c.fbc6a","type":"inject","z":"71ef45d0.31579c","name":"fake serial data 00100017","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"00100017","payloadType":"str","x":1086,"y":608,"wires":[["251cccc3.5a0494"]]},{"id":"d1cd106b.5a9c4","type":"debug","z":"71ef45d0.31579c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload.value","statusType":"msg","x":1346,"y":668,"wires":[]},{"id":"251cccc3.5a0494","type":"function","z":"71ef45d0.31579c","name":"nibble swap","func":"msg.buffer = Buffer.from(msg.payload,\"hex\");\nfor(let i = 0; i < msg.buffer.length; i++) {\n    var b0 = msg.buffer[i];\n    msg.buffer[i] = (b0 << 4) + (b0 >> 4);\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1346,"y":608,"wires":[["4a94297d.408b38"]]},{"id":"4a94297d.408b38","type":"buffer-parser","z":"71ef45d0.31579c","name":"","data":"buffer","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint32be","name":"value","offset":0,"length":1,"offsetbit":0,"scale":"1","mask":""},{"type":"buffer","name":"buffer","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":""},{"type":"hex","name":"hex","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":"output","multipleResult":false,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1136,"y":668,"wires":[["d1cd106b.5a9c4"]]}]

Steve ....

a very big ThankYou!!!! Without that help my project would be stoped at this point i think.

And it could be a big help for all who would like to play with node red at their CarreraDigital :wink:

Agian: Thank You!

ALEX

ps: I have no big experience in work with Forums ..... have I to do something to close this Thread? :grimacing:

set the post you believe to be the solution as the solution :slight_smile: