00197195-02-UG SetupCenter 5.1_en.pdf - 第90页

Barcode Barcode Labels Regular Expression - Basics 90 User Guide SIPLACE Setup Center 5.1 5.1.4 Regular Expression - Basics To process the contents of scan ned barcodes, you need to crea te comparative templa tes, which …

100%1 / 196
Barcode
Practical Example Barcode Labels
User Guide SIPLACE Setup Center 5.1 89
5.1.3.7 Expert Mode
With the help of the graphic tools the generation of the barcodes is instantly converted into a regular ex-
pression and displayed in the Schema field.
If the tick at Expert mode is activated, the syntax of the regular expression can be edited.
A change in the fragment Ignore is a reasonable usage of the expert mode.
For example: The character "Q“ in the quantity will not be further processed later on. However, you still
want to ensure that only those barcodes with the prefix "Q" may be used as quantities. The character
"Q" is therefore entered in the Ignore fragment. Quantities without a "Q" or those with another prefix char-
acter will be ignored.
One of the special qualities of the fragment types OriginalQuantity and Quantity is that a prefix can be
entered directly into the fragment.
5.1.3.8 Checking Barcode
You have the possibility to check a barcode with the settings in the barcode labels.
NOTICE
Expert Mode
Consequences
Complex changes to the regular expression via the expert mode can not always be accu-
rately displayed in the diagram.
Barcode
Barcode Labels Regular Expression - Basics
90 User Guide SIPLACE Setup Center 5.1
5.1.4 Regular Expression - Basics
To process the contents of scanned barcodes, you need to create comparative templates, which are
stored in the system as barcode patterns. These serve as a reference against which scanned barcodes
are compared, to decide whether they are correct or incorrect.
Regular expressions are used to define barcode patterns. They describe the barcode information and
subdivide it into individual fragments, with the help of pattern matching.
5.1.4.1 Barcode Pattern
The barcode pattern enables the user to formally describe the content of a scanned-in barcode. The bar-
code pattern consists of the individual patterns for a barcode fragment. It defines:
1. The part of the barcode which is assigned to a certain barcode fragment type e.g. the component,
unique barcode or the original quantity of the packaging unit.
2. The format of the barcode fragment contents.
3. The order in which the sections for the barcode fragments appear in the barcode.
The so-called pattern matching plays a decisive role in the processing of scanned-in barcode contents.
The question is how to describe the required text passages of a decoded barcode. If the text passage is
already exactly known, it can be directly entered during the search. This search function is identical with
that from all other editors.
However, this is not the most flexible of options. For example, if you want to determine the original quan-
tity of the packaging unit from the barcode and then discover that this consists only of a string of num-
bers, you are faced with a problem. This type of designator can not be adequately described by writing
it down or by listing the various options. This is where so-called "Regular Expressions" can help.
Regular expressions serve to describe the format of a barcode. They are a syntactic utility for the de-
scription of a character string. An example of a barcode, from which the original quantity of a packaging
unit, with the prefix ‚Q', is to be extracted, can be seen below:
^(?<Ignore>Q.{0,0})(?<OriginalQuantity>[0-9]{5,8})$
Let's go through it step by step. We first see the character"^'" which means that the barcode begins here.
It is vital that this character is positioned here, otherwise any number of other characters could be placed
before the string described below and the barcode would still be recognized.
We then see the definition for the barcode fragment "(?<Ignore>Q)". The fragment type "Ignore" means
that the content is not to be stored in the database but that this string of characters appears frequently
in the barcode, as a prefix or postfix. In this case, the character "Q" would always be expected before
the original quantity and, if the character "Q" was missing, the scan would terminate with errors.
Open the Extras => Settings =>Barcode labels menu.
Scan the barcode to be checked and the scanned
barcode will be entered in the Scanned barcode input
field (3).
Select the relevant barcode label at Label name (1).
Open the context menu and select the Match (2)
function. The scanned barcode is matched with the
settings of the corresponding barcode label.
⇨ The dialog box showing the Barcode matching re-
sults is opened and the results are displayed.
Barcode
Regular Expression - Basics Barcode Labels
User Guide SIPLACE Setup Center 5.1 91
This is then followed by the definition "(?<OriginalQuantity>[0-9]{5,8})" of the packaging unit original
quantity. In this case, the fragment type is "OriginalQuantity", which corresponds to the starting quantity.
The format definition "[0-9]{5,8}"' restricts the character class to the numbers "0" to "9", which ensures
that the original quantity can only be a positive amount. The length "{5.8}" specifies the minimum (5) and
maximum (8) amount of numbers which may be used to define the original quantity.
Lastly, we see the symbol "$", which means that the barcode ends here. It is vital that this character is
positioned here, otherwise any number of other characters could be placed after the string described
above and the barcode would still be recognized.
Please note that a barcode fragment always has the syntax "(?<FragmentType>.{n,m})". The "." in this
syntax can be replaced by other characters or special characters. The characters 'n' and 'm' are always
numbers, which represent the minimum (n) and maximum (m) amount of the pattern located before
them. Furthermore, a barcode should always be framed by "^...$", to clearly indicate where it begins and
ends.
Regular Expression Syntax
Regular expressions are used to define barcode patterns. They describe the barcode text and subdivide
it into individual fragments, with the help of pattern matching.
Individual Characters and Character Classes
The regular expression consists of a character string. Each character in this string stands for itself, un-
less it is one of the special characters +?.*^$()[{|\. The special meaning of these characters can be
canceled by placing a \ before the character concerned e.g. \? or \\.
NOTICE
Extra1, Extra2, Extra3
A barcode label should define a barcode fragment for all parts of a scanned-in barcode.
If the content does not correspond to any predefined fragment type, the fragment types
'Extra1’, 'Extra2’ or 'Extra3' should be used. If you are absolutely sure that a string of char-
acters can be rejected and will not be required again, assign the fragment type ‚Ignore' to
that string.
NOTICE
Diagram of a Barcode Label
The "Barcode label detailed" view can not graphically display all types of a particular bar-
code pattern. For example, the graphic representation of the length may differ from the
sample length defined in the barcode pattern. It may also not be possible to show some
highly complex barcode patterns as a graphic.
Character class Description
. Recognizes any character.
[aeiou] Recognizes each individual character, summarized to form a class of characters
to be recognized.
[^aeiou] Recognizes each individual character which is not in the class of characters.
[0-9a-fA-F] The hyphen allows you to describe a string of connected characters.
\w Recognizes each alphanumeric symbol and an underscore. \w has the same
meaning as [a-zA-Z_0-9].
\W Recognizes each non-alphanumeric symbol and an underscore. \W has the same
meaning as [^a-zA-Z_0-9].
\s Recognizes each whitespace character. \s has the same meaning as [ \f\n\r\t\v].