Extract the weight from EAN-13 barcode and sum the total weight
HI,
Tried to look up for this but couldn't find an answer. I am not a pro in Bartender but trying to learn. We have Enterprise edition. I need to make a pallet GS1 label for products with variable weight.
The weight of each box is on its label with EAN13 barcode. I need to extract the weight from the barcode (positions 7 to 12) with a scanner and calculate the total amount of all boxes on the pallet. Then I need to put this total number in kg in the GS1 barcode with AI 3302.
After that we have to print the label and for the next one - to start summing up the total weight again.
How can I do this? Is it necessary to use an external database or it could be done on the label itself?
I hope I am not missing something.
Thanks in advance
-
Peter Thane
★ BarTender Hero ★
Are the EAN13 codes used on the Pallet sheet too or is it just the total you want? Also what is the maximum number of items that you would have to scan?
1 -
Nickolai Gaidardjiev
★ BarTender Hero ★
Hi Peter,
The EAN is only used for the total weight calculations. The total amount of boxes on the pallet that I need to scan for the calculations is around 25
Nick
0 -
Nickolai Gaidardjiev
★ BarTender Hero ★
Anything?
0 -
Peter Thane
★ BarTender Hero ★
As the data isn't already on the label then it is quite an in depth process to achieve this as the software isn't really designed to perform maths processes and so scanning these into a spreadsheet said to extract the characters you want and then add these up to give the user a total they can manually enter into BarTender would be far simpler.
For BarTender to do it I think you would need to add X fields to the side of the label and link each of these to a Data Entry Form input box. You could use the Transforms options to strip off the characters you do not want leaving you with just the weights. A separate field that uses VB would be needed to add up these values together and provide the total weight you require.
0 -
Nickolai Gaidardjiev
★ BarTender Hero ★
Thanks Peter,
Yes, I was thinking about the first option, but then we want to try and have it as automated as possible so if we can skip the manual entry of the total weight it would be perfect.
I will give your second suggestion a try and let you know. Thanks again,
0 -
Nickolai Gaidardjiev
★ BarTender Hero ★
Hi again Peter,
The second concept you suggested is working with one issue - I cannot make the values of the fields to sum up. I can divide them, substract them but I cannot use the + function on them. It only adds the numbers one to each other like this: "000300000350000400" which are the values of the 3 fields - 000300, 000350 and 000400. I presume the problem is that those are text fields? If I make them number fileds, then I cannot use the Transforms option.
What I use for VB is the following (the fields are named w1, w2 and w3 for the example):
Value1 = Format.NamedSubStrings("w1").Value
Value2 = Format.NamedSubStrings("w2").Value
Value3 = Format.NamedSubStrings("w3").Value
Value = Value1 + Value2 + Value3On PostPrompt event.
Any idea how can I get over this?
0 -
Peter Thane
★ BarTender Hero ★
The VB is still thinking it is adding text together and so is concatenating the values but if you include the Int command then that will fix this
ie
Value = Int(Value1) + Int(Value2).......
0 -
Nickolai Gaidardjiev
★ BarTender Hero ★
You are a legend, Peter :) Thanks a lot, it works now.
And last question, if you have the time - any script that can reset the values of the text fields back to blank or zero? Or clear the data in them? I am just thinking how to make the operator start the next pallet without much effort.
0 -
Peter Thane
★ BarTender Hero ★
Mine does already.
You could look at these settings for the Data Entry Boxes....
....or else add a Clear Button from the Properties of the Data Entry Form. If there is anything else on the Form you may want to move the scanning entries to a new different Form unless you get the user to process these first.
0 -
Nickolai Gaidardjiev
★ BarTender Hero ★
Works fine, thank you!
Now working on overcoming the error when some of the fields are empty - no data is entered into them. It works like that too, but it gives an error for the VB script when I click preview.
0 -
Peter Thane
★ BarTender Hero ★
You could try to give all the entry boxes a default value of 0
0
Please sign in to leave a comment.
Comments
11 comments