Code 128 Application Identifiers : Can barcode scanner pass as (

A code 128 barcode segments data by using application identifiers. One of the identifiers is 3202. In the barcode, the 3202 is enclosed in parentheses ie: (3202). This AI tells me there are 6 digits following the (3202) and that the number has two decimal positions.

When I read a barcode with my barcode scanner, the "()" are not included with the scan. I can see the application identifier (such as  the 3202 pounds, net weight, 6 digits, 2 decimals). However, it is not enclosed in parenthesis.

I am trying to write code that will parse the barcode data, find the AI's and determine what information follows.
(01)90078155006458(3202)005032
Find 1st (
Find )
Extract data from between ().
This tells me what data and the size of the data field that follows
Now I should be able to extract the info from the barcode using the information I have.

The problem is, the parentheses do not come thru with the barcode.
Can I setup my scanner to expose this data
LVL 1
rodneygrayAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Gustav BrockCIOCommented:
> Can I setup my scanner to expose this data

I guess so. Get hold of or download the manual which usually contains a lot of pages with specialized barcodes which you scan to program the scanner to behave differently.

/gustav
0
DansDadUKCommented:
>> ... read a barcode with my barcode scanner, the "()" are not included with the scan ...

Can you post an image of a sample bar-code, so we can see just what is encoded in that bar-code?

This should tell us whether or not the "(" and ")" characters are encoded in the bar-code.
If not, it may be a restriction of whatever code you are using to generate the bar-code, or it may be that you are mandating a Code 128 subset which does not support non-numeric characters.
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Rodney,

 As has been said, you'll need to get the manual for the scanner your using in order to control the output.    

Your really not looking for the ( ), but the FNC1 code, which denotes that the data that follows is an application identifier.   Decoding a 128 bar code with AI's is also a bit further complicated by the fact that if the AI data is fixed, another FNC1 code does not need to appear for additional data.

 So the easy way is to get the scanner to output the ()'s

Jim.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

rodneygrayAuthor Commented:
First, thanks for all the prompt replies and useful information. I had no idea on how to proceed with this project. You have all given me useful information. I will post a barcode screenshot later today.

To summarize all three comments, reading barcodes and decoding data begins with the printed barcode. In order to scan the barcode and extract AI data,  the AI must be enclosed within () on the printed barcode. However, per Jim, there is an additional caveat related to FNC1 codes. I will have to research that.

As the barcode is generated by software that is outside my control (I can't change output), I have to continue with my original code which extracts data based upon positional parameters. This works fine for company produced barcodes. However, we receive product from other vendors and that data can vary based upon the vendor label format. I wanted to write code that would extract data from any Code 128 barcode, extracting data based upon AIs. It looks like I will have to determine positional parameters and AIs for each company we receive barcoded product from and extract data based on those parameters.  That's a very inflexible system.

Has anyone ever written code for reading barcodes and extracting data based upon AI's? Or, can you point me in the direction for information concerning how to do this?
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<Has anyone ever written code for reading barcodes and extracting data based upon AI's? >>

 Only in a limited way to ensure that the bar codes I was producing were correct.

<<Or, can you point me in the direction for information concerning how to do this? >>

It is what you would typically expect with any string:

1. You can use Split() based on a delimiter to get it into an array.

2. If unstructured, you need to read it byte by byte using Mid$(), Left$(), Right$(), and InStr() to parse it apart.

Given what you've said, you'll need to use method #2.   Loop through the sting, looking to see if you hit a (  or FNC1, then look at the next character, based on that the rules for AI's (is it 2, 3, or 4 digits), then is the data following fixed or variable.

Sometimes there is not a good approach other than brute force

Jim.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rodneygrayAuthor Commented:
Thanks Jim. The brute force method is what I will have to use. Because I do not have the luxury of having the () embedded in the I will create a table for each company we receive product from. I will enter the beginning/ending position and data type for each column in the barcode. The first data set that is in the barcode is the organization id. This is a fixed field. I can extract the org id an then pull parameter data from the barcode.
0
DansDadUKCommented:
I'm no expert with Code 128 / EAN 128 bar codes, or Application Identifiers, but (partly so I can try to understand this) I've done a bit of research.

It would seem that the "(" and ")" characters are not expected to be present in bar-codes, but are conventionally used with some bar-code generation software packages to indicate an AI; the package then determines (from the value of the enclosed AI) whether or not to insert a FNC1 character in the generated bar-code at that point.

There are a number of defined AIs; some are fixed length, others are variable length.
With the fixed-length ones, it is easy to determine where the next AI (if present) should start.
With the variable length ones, an additional FNC1 character needs to be inserted in front of any following AI.

This is best illustrated by example.
I've taken some of the bar-code samples from the the "GS1 AI (Application Identifier) & Element String Specifications" page of the Id Automation web site - see http://www.idautomation.com/barcode-properties/definitions/gs1-application-identifiers.html and annotated them with decodes of the actual bar-code symbols:

  One fixed-length AI (01)Two fixed-length AIs (01) and (15)Two variable-length AIs (10) and (21)
 

 

With all of these, a FNC1 character follows the initial Start character (start subset C in each case) to indicate that AIs are present.
It is only with the third sample, where the first AI is variable-length, that an additional FNC1 character is inserted to indicate the start of the next AI.

All three samples include check-sum characters before the trailing STOP character.
The second and third samples include 'change subset code' characters because some of the data fragments do not contain even numbers of (paired) integer values.
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<It would seem that the "(" and ")" characters are not expected to be present in bar-codes, but are conventionally used with some bar-code generation software packages to indicate an AI; the package then determines (from the value of the enclosed AI) whether or not to insert a FNC1 character in the generated bar-code at that point.>>

 That's the jist of it.  () is not in the actual code itself, but is typically in the human readable.   Scanners them selves also have a wide range of options and some can insert it into the data as if it was scanned that way.

So depends on the scanner.  But if your not controlling it, then it would be best to assume your going to see the FNC1 character, know the rules for applying it, and brute force parse the resulting string for data.

In order to do so correctly, you have to know all the AI's and what type of data they represent (fixed or variable).

Jim.
0
DansDadUKCommented:
>> ... it would be best to assume your going to see the FNC1 character, know the rules for applying it, and brute force parse the resulting string for data ...
>> ... In order to do so correctly, you have to know all the AI's and what type of data they represent (fixed or variable) ...


Agreed.
0
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
There's a list of those here:

http://www.gs1.org/docs/barcodes/GS1_General_Specifications.pdf

Section 3.

Jim.
0
rodneygrayAuthor Commented:
Thank you Gentlemen for going above and beyond in answering my questions. I appreciate your interest and timely answers to my query. I will look into the information you have so generously provided. I will post what I find. Thanks again!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.