Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X
Hi Experts,
I created a barcode reader and decoder in Thingworx.
A product bag contains a paper with 3 barcodes. I read 3 different barcodes and split them. After the splitting I get 4 different strings. All of splitted strings stored in an infotable.
var params = {
infoTableName : "InfoTable",
dataShapeName : "DS_BaleMgmt_Barcode"
};
dataShapeName:STRING):INFOTABLE(DS_BaleMgmt_Barcode)
var res = Resources["InfoTableFunctions"].CreateInfoTableFromDataShape(params);
var newEntry = new Object();
newEntry.IRMS = "splitted string"; // STRING
newEntry.LOT = "splitted string";// STRING
newEntry.SSCC = "splitted string";// STRING
newEntry.QTY = "splitted string"; // STRING
..........
res.AddRow(newEntry);
If I scan the top barcode the service run without fail. But if I scan the other barcodes, the previously splitted strings deleted from infotable and textbox on mashup. How can I save all of barcodes/strings while I read all of them and write the strings to a database? Is there a temporary saving method for that?
I created Properties in the thing and write them, but after the service run the result is same.
Thanks in advance
Hello @Szennaik,
From your code sample you provided. You are creating the InfoTable each time you process a barcode. If you create the barcode as property of the "THING", When your service runs it can add a row to the existing table if that is the desired processing. It was not clear to me what the desired processing was for the second scan.
Let me know if this helps
Thanks
Peter
Hello @PEHOWE ,
I have attached pictures of the scanning logic with 2 different product labels.