# Creation of Function Node

**URL:** <https://discourse.nodered.org/t/creation-of-function-node/34170>\
**Category:** General\
**Created:** [13 October 2020 10:24 UTC](https://discourse.nodered.org/t/creation-of-function-node/34170 "2020-10-13T10:24:33Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [13 October 2020 12:04 UTC](https://discourse.nodered.org/t/creation-of-function-node/34170/10 "2020-10-13T12:04:52Z")

</div>

Acording to the PDF with sample data you could so this...

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

which matches this...  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/c/5c23f2ced2d84b472abdad2c52d109d3f1f02cb3.png)

using buffer parser set as per the info you provided...

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

Demo flow...

```auto
[{"id":"99b86a91.cc8f18","type":"inject","z":"b489a0e4.4dd7e","name":"test data AgH5e5xFaIdRRA==","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"data\":\"AgH5e5xFaIdRRA==\"}","payloadType":"json","x":820,"y":100,"wires":[["88fc873f.c086c8"]]},{"id":"2bb51028.cbdab","type":"buffer-parser","z":"b489a0e4.4dd7e","name":"","data":"payload.data","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"floatle","name":"lat","offset":2,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"floatle","name":"lon","offset":6,"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,"setTopic":true,"x":1110,"y":160,"wires":[["2057e639.f3a49a"]]},{"id":"b4228108.10405","type":"debug","z":"b489a0e4.4dd7e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1290,"y":100,"wires":[]},{"id":"2057e639.f3a49a","type":"debug","z":"b489a0e4.4dd7e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1290,"y":160,"wires":[]},{"id":"363f26cc.7e8fda","type":"inject","z":"b489a0e4.4dd7e","name":"click me","props":[{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":760,"y":160,"wires":[["2b6a66d1.86484a"]]},{"id":"2b6a66d1.86484a","type":"function","z":"b489a0e4.4dd7e","name":"test data 02 01 F9 7B 9C 45 68 87 51 44","func":"msg.payload = { data: Buffer.from(\"0201F97B9C4568875144\", \"hex\") }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":860,"y":200,"wires":[["2bb51028.cbdab","29572a95.8942b6"]]},{"id":"88fc873f.c086c8","type":"base64","z":"b489a0e4.4dd7e","name":"","action":"","property":"payload.data","x":1100,"y":100,"wires":[["b4228108.10405","2bb51028.cbdab"]]},{"id":"29572a95.8942b6","type":"debug","z":"b489a0e4.4dd7e","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":1290,"y":200,"wires":[]}]

```

---

_[View the full topic](https://discourse.nodered.org/t/creation-of-function-node/34170)._
