# Node Red socketcan output frame received problem

**URL:** <https://discourse.nodered.org/t/node-red-socketcan-output-frame-received-problem/73297>\
**Category:** General\
**Created:** [6 January 2023 13:35 UTC](https://discourse.nodered.org/t/node-red-socketcan-output-frame-received-problem/73297 "2023-01-06T13:35:16Z")\
**Posts on this page:** 1\
**Showing post:** 5

<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:** [6 January 2023 15:18 UTC](https://discourse.nodered.org/t/node-red-socketcan-output-frame-received-problem/73297/5 "2023-01-06T15:18:32Z")

</div>

You havent shown us how you are extracting the data (though I can guess where you are going wrong)

You can use `buffer-parser` for these kind of conversions.

I have also added a DIY function for comparison...

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

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/2/8247e26b19a83b4bda5fcfeda6435897f73683f8.png)

Demo flow (use `CTRL+I` to import)

```auto
[{"id":"5cc7cc13ae146210","type":"inject","z":"3ce7b2dfd0389010","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"000C0300#20010410","payloadType":"str","x":1560,"y":580,"wires":[["62f29b073ef65185"]]},{"id":"62f29b073ef65185","type":"function","z":"3ce7b2dfd0389010","name":"remove data before #","func":"const parts = msg.payload.split('#')\nmsg.payload = parts[1]\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1800,"y":580,"wires":[["85240c9841bd2da2","7e296ef1a5b95560"]]},{"id":"85240c9841bd2da2","type":"function","z":"3ce7b2dfd0389010","name":"get value","func":"const buf = Buffer.from(msg.payload,\"hex\")\nmsg.payload = {\n item1: buf.readUint16LE(0) / 100,\n voltage: buf.readUint16LE(2) / 100,\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2000,"y":580,"wires":[["0a5ca2d32ff6c518"]]},{"id":"7e296ef1a5b95560","type":"buffer-parser","z":"3ce7b2dfd0389010","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"uint16le","name":"item1","offset":0,"length":1,"offsetbit":0,"scale":"/ 100","mask":""},{"type":"uint16le","name":"voltage","offset":2,"length":1,"offsetbit":0,"scale":"/ 100","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":2010,"y":640,"wires":[["8a662f13e58752d0"]]},{"id":"0a5ca2d32ff6c518","type":"debug","z":"3ce7b2dfd0389010","name":"debug 157","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2160,"y":580,"wires":[]},{"id":"8a662f13e58752d0","type":"debug","z":"3ce7b2dfd0389010","name":"debug 158","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2180,"y":640,"wires":[]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/node-red-socketcan-output-frame-received-problem/73297)._
