====== Barcode Processing ======
When a barcode is scanned in TapeTrack it is sent to the Server component to be interpreted and split (or parsed) into its respective components.
===== Barcode Syntax Rules =====
A TapeTrack Barcode may be up to 20 characters in length and may contain a [[:master:customer|Customer-ID]] and [[:master:media|Media-ID]] component and must contain at least a [[master:volumes|Volume-ID]] component.
barcode format: ''CUST.MEDIA.VOLUME'' \\
{{common:common_barcode_fully_qualified.png}} {{US04.LTO.120000L5.png}}
barcode format:'' VOLUME'' \\
{{common_barcode_volume.png}} {{120000L5.png}}
==== Parsing Logic ====
The TapeTrack Server parses barcodes as follows:
The unparsed barcode will be looked up in the [[subsystem:barcode|Barcode Translation Table]] and if it is found the translated barcode will be substituted.
When a corresponding [[Barcode Interpretation Definition|Barcode Interpretation Definition]] is found the barcode is split into [[:master:customer|Customer-ID]], [[:master:media|Media-ID]] and [[:master:volumes|Volume-ID]] components.
If the [[:master:customer|Customer-ID]] and [[:master:media|Media-ID]] components are not resolved then the [[desktop:scan_window#Setting-the-Default-Customer-ID-and-Media-ID|Scanned Default Customer-ID]] and [[desktop:scan_window#Setting-the-Default-Customer-ID-and-Media-ID|Scanned Default Media-ID]] values (if any) are used to set the [[:master:customer|Customer-ID]] and [[:master:media|Media-ID]].
If the [[:master:customer|Customer-ID]] and [[:master:media|Media-ID]] components are not resolved then the [[master/user#defaults| User Profile Default Customer-ID]] and [[master/user#defaults|User Profile Default Media-ID]] values (if any) are used to set the [[:master:customer|Customer-ID]] and [[:master:media|Media-ID]].
If the [[master:media|Media-ID]] component remains unresloved and the [[master:customer#options| Customer Properties]] has the ''Disallow Customer Duplicates'' Attribute set then the server will attempt to find the [[master:media|Media-ID]] for the unique [[master:volumes|Volume-ID]] if the [[master:volumes|Volume-ID]] exists.
Using the [[master:customer|Customer-ID]] and [[master:media|Media-ID]] values the [[master:media#options-tab|Media Properties]] are looked up.
If the [[master:media#options-tab| Media Properties]] has the ''Remove Barcode Suffix'' value set and there is a matching suffix, the suffix is removed.
If the [[master:media#options-tab | Media Properties]] have the Modulo 43 option **AND** there is no corresponding length exclusion all except the last digit of the component [[master:volumes|Volume-ID]] are processed through the Modulo 43 algorithm.
If the last digit of the [[master:volumes|Volume-ID]] does not match the calculated Modulo 43 value a barcode scanning error is returned.
If the last digit of the [[master:volumes|Volume-ID]] does match the calculated Modulo 43 value the barcode is returned with the [[master:volumes|Volume-ID]] component stripped of it's check digit.
==== Additional Logic for Batch Programs ====
Batch programs that parse barcodes will also check for the existence of the environment variable [[:variable:tmss10barcodeconfig|TMSS10BARCODECONFIG]] when the program starts.
This variable is used to define the path to a config file containing settings that influence how barcode is performed.
set TMSS10BARCODECONFIG=c:\tmss\etc\barcode.cfg
TMSS10ValidateBarcode
==Example Batch Barcode Config File==
defaults =
{
customer-id = "ACME";
media-id = "DL";
};
=== Programs that load the Barcode Config File ===
[[cli:tmss10sync|TMSS10Sync]] \\
[[cli:tmss10inventory|TMSS10Inventory]] \\
[[cli:tmss10validatebarcode|TMSS10ValidateBarcode]] \\
== See Also ==
[[technote:modulo43-barcodes|Modulo 43]]
[[Category:Barcode Scanning]]
{{tag>technote barcode update-doco}}