Converter decimal 16 bits to UFT-8

Hi,

I receive this array, it's a decimal 16 bits and I need to convert it to UFT-8 text
Capturar
It converted should show the date 06/04/22
How can I do this?

You can use a function node and write the 3 values as Int16 Big Endian then call toString to convert the buffer back to a string.

or

use node-red-contrib-buffer-parser

[{"id":"88936db8a9d97190","type":"inject","z":"1bd2b382.4dd4f4","name":"[13872,12335,12084,12850,0]","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[13872,12335,12084,12850,0]","payloadType":"json","x":920,"y":1088,"wires":[["ecdca6d950e0daa8"]]},{"id":"ecdca6d950e0daa8","type":"buffer-parser","z":"1bd2b382.4dd4f4","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"string","name":"item1","offset":0,"length":-1,"offsetbit":0,"scale":"1","mask":""}],"swap1":"swap16","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"value","resultTypeType":"return","multipleResult":true,"fanOutMultipleResult":false,"setTopic":true,"outputs":1,"x":1158,"y":1088,"wires":[["0cdd2843660a2bd5"]]},{"id":"0cdd2843660a2bd5","type":"debug","z":"1bd2b382.4dd4f4","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1338,"y":1088,"wires":[]}]

Thank you very much

image

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