cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community email notifications are disrupted. While we are working to resolve, please check on your favorite boards regularly to keep up with your conversations and new topics.

Barcode reader temporary data

Szennaik
7-Bedrock

Barcode reader temporary data

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

2 REPLIES 2

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

 

Szennaik
7-Bedrock
(To:PEHOWE)

Hello @PEHOWE ,

 

 
In the meantime, I managed to solve the problem of scanning The original goal was to process the barcodes with 1 service. in this case, when scanning another barcode, if there was already data at one of the outputs, it was overwritten with blank text. Because the new barcode did not contain the previously scanned data.
 
That is why I dismantled the checks. First, I check what the barcode type is and  the length of barcode. The length of the barcode also determines its type. Based on this, you decide which additional service to run for processing. This way I run 2 services in a row and the previously scanned data is retained.
 

I have attached pictures of the scanning logic with 2 different product labels.

Top Tags