How to check the operator has scanned the correct Barcode before
starting a test.
One of the problems we had was that a customer wanted 3 different barcodes to be
scanned before the product was tested, each barcode was made up of differing
lengths and characters so the challenge was to make sure the operator scanned
the correct barcode when asked. This data was then used to print labels with the
correct barcode being in the right place.
Now this is possible using ‘Regular Expressions’ but complicated for some people
to understand, so we developed a new coding system for barcodes and let the
SubVI take care of converting the easy code to a regular expression.
The easy code is as follows
Character |
Description |
A |
Any Alpha Character |
N |
Any Numerical Character |
X |
Any Alpha-Numerical Character |
() |
Dedicated Character |
NOTE – You should take precaution using the ‘X’ character as
this is a lazy check and could make the definition more prone to false
positives, and these are the only characters you can use to define the barcode
makeup, you may add symbols like * directly if needed
() Dedicated characters mean at that position there will always be this
character.
So let’s see what the definition code would be for a barcode, we will use
SP0025AS as an example, the ‘SP’ at the beginning will
always stay the same. ‘0025’ is a number and will change from
barcode to barcode and finally, ‘AS’ the ‘A’
can change to a number as well as another letter, the ‘S’ can
change to another letter only.
So our example barcode make up is as follows, (S)(P)NNNNXA and
is 8 characters long, this is the string you would input to the SubVI along with
the scanned barcode, then process the output ‘Barcode is Matched’ for a Boolean
‘True’
Of course our input barcode definitions come from a Database and the routine is
more automated than this.
I hope this helps someone, Ask questions if needed.