Hello
I tried with a PC software and it does read correctoly.
Mu node-red cose is:
var buffer = msg.payload;
var len = buffer.length;
var i=0;
var value="";
var valuefinal = "";
var chars ="1234567890";
while(i<len)
{
var sub = buffer[i];
if(sub >= 0x1e && sub <= 0x27 )
//if(sub !== "")
value = value + chars.charAt(sub - 0x1e);
i+=1;
}
msg.payload= value;
return msg;
Then I use batchder ad a string covnersion. The node-red clipboard is:
[{"id":"b6f97b89.a04878","type":"function","z":"93f35d7f.df912","name":"READ MAIN BARCODE","func":"var buffer = msg.payload;\nvar len = buffer.length;\nvar i=0;\nvar value="";\nvar valuefinal = "";\nvar chars ="1234567890";\nwhile(i<len)\n {\n var sub = buffer[i];\n if(sub >= 0x1e && sub <= 0x27 )\n //if(sub !== "") \n value = value + chars.charAt(sub - 0x1e);\n \n i+=1;\n }\nmsg.payload= value;\nreturn msg;\n","outputs":1,"noerr":0,"x":736,"y":531,"wires":[["6b9c49cc.fd8db"]]},{"id":"5d548a87.40ed5c","type":"HIDdevice","z":"93f35d7f.df912","connection":"ba271608.0846c","name":"READER 2","x":487.75,"y":539.75,"wires":[["b6f97b89.a04878"],[]]},{"id":"6b9c49cc.fd8db","type":"batcher","z":"93f35d7f.df912","name":"BATCHER BUF","maxTopics":"1","maxMessagesPerTopic":"10","maxDelay":"100","x":965.36669921875,"y":530.5,"wires":[["a80033e.eb389d"]]},{"id":"a80033e.eb389d","type":"string","z":"93f35d7f.df912","name":"COVERT TO STRING","methods":[{"name":"append","params":[{"type":"str","value":""}]},{"name":"strip","params":[{"type":"str","value":","}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":1223.7666015625,"y":529.4833068847656,"wires":[["4bc16739.52f13","dc0206d0.c49838"]]},{"id":"ba271608.0846c","type":"HIDConfig","z":"","vid":"5050","pid":"24","name":"READER 1"}]
Thabks a lot