ASCII characters display

Hi,

I want to dispaly data from ASCII RFID over node-RED dashboard....Is it possible to display ASCII characters on dashboard?
I am able to display decimal data..
image

.is there any function block for decimal to ascii conversion?
Thanks , BR
Madhumati

Hi,

if you search for "javascript convert ascii to character" or any variation of that, you'll find lots of answers.

For example: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode

Hello,

Please see below flow implemented

Stil it gives decimal output only..It should display as 72 & "H"

is anything wrong with the function?attached my script.
[{"id":"1883d8a3.7f7277","type":"fieldbus in","z":"72ae79d4.72cc28","name":"H","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_1","fieldbusObj":"ffc3a842.8712e8","x":130,"y":100,"wires":[["2f165c6.0042ba4","7739c029.9d72c"]]},{"id":"7992bcd0.b35904","type":"fieldbus in","z":"72ae79d4.72cc28","name":"I","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_2","fieldbusObj":"ffc3a842.8712e8","x":130,"y":160,"wires":[["c50475f8.2717e8","d34bd3eb.b2fc7"]]},{"id":"e028427d.b09da","type":"fieldbus in","z":"72ae79d4.72cc28","name":"L","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_3","fieldbusObj":"ffc3a842.8712e8","x":130,"y":220,"wires":[["55af5725.5e9a58","35ac1158.cf4d0e"]]},{"id":"a826855.81dc178","type":"fieldbus in","z":"72ae79d4.72cc28","name":"S","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_4","fieldbusObj":"ffc3a842.8712e8","x":130,"y":280,"wires":[["adaa0e7a.551fc","e8e0181c.267388"]]},{"id":"b3a4129a.e4343","type":"fieldbus in","z":"72ae79d4.72cc28","name":"C","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_5","fieldbusObj":"ffc3a842.8712e8","x":130,"y":340,"wires":[["57c6b960.2f7198","11b2079a.eb0e78"]]},{"id":"4b349dbc.3640b4","type":"fieldbus in","z":"72ae79d4.72cc28","name":"H","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_6","fieldbusObj":"ffc3a842.8712e8","x":130,"y":400,"wires":[["ce116469.2d4b68","c92b6061.28db3"]]},{"id":"42313123.08af4","type":"fieldbus in","z":"72ae79d4.72cc28","name":"E","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_7","fieldbusObj":"ffc3a842.8712e8","x":130,"y":460,"wires":[["edc8f4e8.510108","619d6572.a7407c"]]},{"id":"eaf70d0c.51225","type":"fieldbus in","z":"72ae79d4.72cc28","name":"R","FieldbusNodeVersion":"1.2.7","WrapperVersion":"1.2.7","WrapperCompileDate":"Nov 20 2018/09:00:05","MinExpectedNodeJSVersion":"8.11.4","ActNodeJSVersion":"8.11.4","ActNodeREDVersion":"0.18.7","selectedSignalPath":"input~receive_001~Sig_8","fieldbusObj":"ffc3a842.8712e8","x":130,"y":520,"wires":[["9cf3c17e.b78c9","bf23c42f.6c0728"]]},{"id":"2f165c6.0042ba4","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":430,"y":60,"wires":[]},{"id":"c50475f8.2717e8","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":140,"wires":[]},{"id":"55af5725.5e9a58","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":330,"y":200,"wires":[]},{"id":"adaa0e7a.551fc","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":280,"wires":[]},{"id":"57c6b960.2f7198","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":340,"wires":[]},{"id":"ce116469.2d4b68","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":400,"wires":[]},{"id":"edc8f4e8.510108","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":460,"wires":[]},{"id":"9cf3c17e.b78c9","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":370,"y":520,"wires":[]},{"id":"7739c029.9d72c","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":100,"wires":[["8cdbb478.2a95d8","b3dd2b64.eb81e8"]]},{"id":"d34bd3eb.b2fc7","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":550,"y":180,"wires":[[]]},{"id":"35ac1158.cf4d0e","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":410,"y":240,"wires":[[]]},{"id":"e8e0181c.267388","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":510,"y":300,"wires":[[]]},{"id":"11b2079a.eb0e78","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":360,"wires":[[]]},{"id":"c92b6061.28db3","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":390,"y":440,"wires":[[]]},{"id":"619d6572.a7407c","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":480,"wires":[[]]},{"id":"bf23c42f.6c0728","type":"change","z":"72ae79d4.72cc28","name":"","rules":[{"t":"move","p":"payload.value","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":560,"wires":[[]]},{"id":"8cdbb478.2a95d8","type":"ui_text","z":"72ae79d4.72cc28","group":"f62b414f.f379","order":0,"width":0,"height":0,"name":"","label":"","format":"{{value}}","layout":"row-spread","x":670,"y":60,"wires":[]},{"id":"b3dd2b64.eb81e8","type":"function","z":"72ae79d4.72cc28","name":"ascii","func":"(String.fromCharCode(msg.payload));\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":120,"wires":[["ca9826e1.86d9e8","cf5d5373.1313c"]]},{"id":"ca9826e1.86d9e8","type":"debug","z":"72ae79d4.72cc28","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":810,"y":80,"wires":[]},{"id":"cf5d5373.1313c","type":"ui_text","z":"72ae79d4.72cc28","group":"f62b414f.f379","order":0,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-spread","x":790,"y":160,"wires":[]},{"id":"ffc3a842.8712e8","type":"fieldbus interface","z":"","availableStackName":"PROFINET IO Device (version 3.12, build 0 revision 8): cifX0","interfaceComponents":"{\"fwName\":\"PROFINET IO Device\",\"boardName\":\"cifX0\",\"fwVersionMajor\":3,\"fwVersionMinor\":12,\"fwVersionBuild\":0,\"fwVersionRev\":8,\"prtName\":\"PROFINET IO\",\"className\":\"Device\",\"prtClassNumber\":21,\"commClassNumber\":10,\"channelNumber\":2,\"deviceNumber\":1291105,\"serialNumber\":21005}","clearOutputsOnDeploy":false,"traceFilePath":"/var/log/node-red/node-fieldbus.log","traceLevelWrapper":"wrapper","traceLevelNode":"node"},{"id":"f62b414f.f379","type":"ui_group","z":"","name":"Tag Data","tab":"6db2e41.5a6d61c","disp":true,"width":"6"},{"id":"6db2e41.5a6d61c","type":"ui_tab","z":"","name":"Home","icon":"dashboard"}]

Thanks

What part of the msg object are you trying to modify?

msg.something = …

I want to modify this to ascii character

output of this I use to dispaly on dashboard in text value

Is there any possibility to change the value format to character?

Thanks?

Take a step back.

You said your function didn’t work, so try fixing your function first.

Ok sorry.

I am trying as below now


For the ASCII function, as below

& then display the function output on dashboard asbelow

but now only single value as 72 displayed which is output of 'move' node

You aren’t a new user of Node-RED
So what bit is now missing from your function node?

Tip: compare it with what’s in a new function node…

I changed now function def, but it gives now error -still something wrong?

So compare the error message to my first post...

maybe a re-read of this will help" https://nodered.org/docs/user-guide/messages
and then look at your error message...