Parsing scanned data
We are using the following:
BarTender Designer 2016 R7 Enterprise Automation
Version 11.0.7.3146 (64 Bit)
Windows 10 x64 build 19045
In order to reduce operator error, we would like to be able to have an operator scan a barcode to input data into bartender, but parsed into 3 separate fields.
For example:
Scanning string: (01) 00850008997013 (21) 001585 (17) 23-01-01
Field 1: 00850008997013
Field 2: 001585
Field 3: 23-01-01
Currently, an operator is manually inputting each of the fields.
Is there a way to do this (parse a scanned string into 3 separate fields) in Bartender?
I have tried using VBScript to parse a scanned data as described here:
https://support.seagullscientific.com/hc/en-us/community/posts/360028789754-Parsing-Scanned-Data
but it’s not working, in the help tab of BarTender I found this:
Using VBScript as a Data Source Type
Text, encoder, and barcode objects on a template can receive their data from a number of sources, including your keyboard, database or text files, and your computer's time and date functions. Sometimes, however, you may have special requirements, such as needing to read data from a file, process it, change it in some special way, and then perhaps combine it in an unusual manner with some other data. By offering the power of Microsoft's VBScript as a data source type, BarTender lets you process and combine the data for objects on a template in just about any way imaginable.
To set a data source's type to VBScript
To make Visual Basic Scripting accessible to more than just programmers, BarTender provides three levels of complexity for Visual Basic Script users who want to use VBScript as a data source type.
BarTender does not support automation for data entry controls. If you attempt to use an Object property in a data entry script (such as the OnPrePrompt or OnPostPrompt events), BarTender will return an error and your script will fail to execute.
Do we have the latest version of BarTender or we just can’t do this parsing?
-
BarTender 2016 is not the latest version of BarTender, it has been superseded a couple of times and BarTender 2022 is the current version. However VB was available in BT 2016 and so you should be able to work with it. However there are a couple of questions:
- It would appear you are scanning a GS1 type code of some description, but can you confirm that the barcode you are scanning includes the dashes in the date of the barcode itself or is this just in the human readable string. If this is the data then this is not a valid GS1 symbol as the date elements are all numeric only in YYMMDD format.
- For the serial number (AI 21) part is the string always 6 digits long? AI 21 fields can be upto 20 characters long and so if this is variable length too then that would make the parsing more difficult, unless you have some control of the original symbol and can make the (21) and data the last strings.
- Does the data need to be broken up on the Data Entry screen or could this be handled in the label fields themselves? I.E. could the user scan the full barcode into a field and this data is then passed automatically to the label fields where it is split into it's constituent parts?
The screenshot below relates to the third query and does not use VB but instead truncation to discard various parts of the string and only keep the parts wanted for the strings (ie the last 6 digits for the date) . This has also assumed the scanned data does not have the brackets or dashes encoded in the actual data.
0
Please sign in to leave a comment.
Comments
1 comment