Skip to main content

Search

Search

Extract the weight from EAN-13 barcode and sum the total weight

Comments

11 comments

  • Avatar
    Peter Thane

    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
  • Avatar
    Nickolai Gaidardjiev

    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
  • Avatar
    Nickolai Gaidardjiev

    Anything?

    0
  • Avatar
    Peter Thane

    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
  • Avatar
    Nickolai Gaidardjiev

    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
  • Avatar
    Nickolai Gaidardjiev

    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 + Value3

    On PostPrompt event.

    Any idea how can I get over this?

    0
  • Avatar
    Peter Thane

    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
  • Avatar
    Nickolai Gaidardjiev

    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
  • Avatar
    Peter Thane

    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
  • Avatar
    Nickolai Gaidardjiev

    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
  • Avatar
    Peter Thane

    You could try to give all the entry boxes a default value of 0

    0

Please sign in to leave a comment.