UDI text string on label vs. VBScript does not match
We are printing FDA-compliant GS1 DataMatrix barcodes (UDI labels). The labels are printing correctly, but when I pull the UDI text value via VBScript using Format.Objects("UDI Barcode").Value, the last digit of the GTIN is missing. My goal is to write the UDI string to a separate database via ODBC whenever a label is printed. Everything is working, except that missing digit.
In BarTender Designer, that last digit -- the 14th digit in the GTIN string -- is a check digit and appears on the label, but does not appear anywhere in the "UDI Barcode" Object Value definition. In fact, the GTIN field definition is limited to 13 characters.
How do I get BT to include that check digit in the UDI text string value pulled by VB Script?
-
Jon Gardner
★ BarTender Hero ★
0 -
Peter Thane
★ BarTender Hero ★
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 -
Jon Gardner
★ BarTender Hero ★
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 -
Jose Adam Flores Sr.
★ BarTender Hero ★
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.
Comments
4 comments