For an application I am using a barcode scanner that returns 16 digits numbers like this:
This number is going to be stored in a numeric text field and then has to be broken down into 4 tags, which I already did thanks to all people who helped me here. Something like the table below: (all 4 highlighted tags and zeros have to be deducted). I use those 4 tags to query from an SQL table
I used the code below to split the 16 digits number into 4 tags:
if previousValue.value != currentValue.value: numIn = currentValue.value textIn = str(numIn) slices = [0,7,10,12,len(textIn)] values =  for i, j in zip(slices,slices[1:]): val = int(textIn[i:j]) values.append(val) system.tag.writeBlocking(["[~]ordno"],[values]) system.tag.writeBlocking(["[~]mdlcnt"],[values]) system.tag.writeBlocking(["[~]patpos"],[values]) system.tag.writeBlocking(["[~]qty"],[values])
Now, I want to be able to update that 16 digits number when I enter Lot No and Bin data. So that I can query from the SQL table based on new data of those 4 tags.
In the SQL table, I can select the row based on Lot and Bin data but this is not what I want, I want to be able to get a single number which is the combination of ord no, mdl cnt, pat pos, and qty with all zeros (16 digits in total).
Do you know what would be the best approach to tackle this question?
It was hard to explain this issue well and even select a subject for this question but I hope I was successful in doing it!