Skip to main content

Search

Search

UDI text string on label vs. VBScript does not match

Comments

4 comments

  • Avatar
    Jon Gardner

    0
  • Avatar
    Peter Thane

    BarTender automatically calculates the check digit when it creates a barcode symbol but this does not occur for text objects.

    If you add a new text field off to the side of the label (so it does not print) and make this a VB Script field then you would be able to achieve this with either a Multi-line or Event Controlled Script. The latter maybe the better one to use so that you can control when the VB is run if the data is entered from a variable source such as a database etc.

    The code I used was this

    Value = Format.NamedSubStrings("UDI").Value

    Value1 = UccMod10(Value)

    Value = Value & Value1

    With the Named String details being selected from Named Data Sources options from the column on the right and the Check Digit from the same column and the Functions>Check Digit area

     

    0
  • Avatar
    Jon Gardner

    To get the full UDI text string, create a non-printing text object on the label layout, change the Data Source to use an Object Value, set to the UDI Barcode / Human Readable Text, with a Transform of "alphanumeric only" to eliminate parentheses and spaces. Then point the VB Script to that Object Value. For example, create a text element named "UDI Text" configures as stated, and set the VBScript in the Named Data Source to read:

    Format.Objects("UDI Text").Value

    The question remains as to why the VBScript value for the barcode itself doesn't include the check digit, but it doesn't. I call that a bug.

    0
  • Avatar
    Jose Adam Flores Sr.

    in the pasted image below I Have one data field for the first GTIN14 (Interleaved 2-of-5) Barcode (01) with Value "00860000846134"

    when you extract the value with vbScript,you are missing the Check Digit (in This case 4) so what you need to do is to append the check digit

    using the function UccMod10(Format.NamedSubStrings("GTIN14").Value) to the value of of the barcode.

    In the attached image I demostrate how you can achieve that ( I did it in separate steps, but you can do it all in in one script.

    I did put it all in a label sample (you will need to transfer this Idea to the script)

    I hope this will kind of give you and idea of how to implement your vbScript to achieve the result you are looking for.

    Best Regards.

    0

Please sign in to leave a comment.