# Adding and managing scan rules

Barcode scanning rules define the quantity and sequence of barcodes that the operator will need to scan when the station is in automatic mode. They also define how the data, such as product ID and PR Codes, are extracted from the scanned content.

Each scan rule must contain a barcode for the extraction of product ID.

Product sign-in at the stations in an assembly line with a scan rule assigned will be successful if the expected barcodes are scanned in the specified sequence and the input strings are compliant with the constraints specified for the barcodes in the scan rule.

To add and manage scan rules, you must first navigate to Smart AMS Config.

- Go to the Smart AMS Config address in your web browser by using the Open Smart AMS Config UI shortcut on the Desktop or on the Windows Start menu.
  Sample address: https://localhost:6395. Make sure to replace localhost with the actual IP address of the computer Smart AMS Config is running on.

- To switch to the Scan rules section, select in the Navigation Panel on the left of the page.

- Select Add scan rule, and then specify the name for the rule.

You can undo or redo one or more actions.

- To undo an action, select .

- To redo the previously undone action, select .

- To refresh the data, select

Each scan rule can include multiple barcodes customized the way you want them.

- To add a barcode, select .

- To rearrange scan rules and barcodes, use a drag-and-drop operation. The order of scan rules in the Scan rules section does not affect the workflow. The order of barcodes in a scan rule determines the expected sequence of barcodes.

- To copy a scan rule or a barcode, to paste it, or delete it, use the right-click context menu.

- Use and to expand or collapse items within the section.

## General

Name field: Specify the name for the barcode.

Length field: Specify the length for the barcode (in characters).

Accept larger barcode toggle switch: If turned on, Smart AMS will accept barcodes whose length is greater than the specified value. Turn it off to discard oversized barcodes.

Legal characters list: Select Everything, Numbers and letters, Only numbers, Only letters, Only uppercase letters, Only lowercase letters, or Regular expression.

Regular expression field: To make this field available, select Regular expression in the Legal characters list. The match pattern is treated as a regular expression. Examples: 123? corresponds to 12, 123, 123456, A123B, F1256G. [0-9]{3} corresponds to any three digits: 123, 756, etc.

Extraction ruleset list: Select the data you want to get: Product information or Operator identifier.
If you select Operator identifier, the barcode will be labeled OP in the Scan rules section; the Start position and End position fields, as well as the Product identifier, PR Codes, and PR Code Sequence sections will not be available.

Extract toggle switch: If turned on, Smart AMS will extract the product ID from the barcode. The barcode will be labeled PD in the Scan rules section. If you do not need product ID, turn it off.

The Extract toggle switch must be turned on in exactly one barcode in each scan rule.

Start position field: Enter a number to specify the beginning of product ID in the barcode.

End position field: Enter a number to specify the end of product ID in the barcode. To read to the end of barcode, leave the field blank.

## PR Codes

Each barcode can include multiple PR Codes.

- To make a PR Code available for extraction, select Add PR Code and specify its settings. The barcode will be labeled PR in the Scan rules section.

Prefix field: Specify a prefix that will be automatically prepended to the extracted value.

Start position field: Enter a number to specify the beginning of PR Code in the barcode.

End position field: Enter a number to specify the end of PR Code in the barcode. To read to the end of barcode, leave the field blank.

To delete a PR Code, right-click it, and then select Delete.

## PR Code Sequence

Extract toggle switch: If turned on, Smart AMS will extract multiple PR Codes from the barcode; the barcode will be labeled PR in the Scan rules section. To disable this feature, turn it off.

Start position field: Enter a number to specify the beginning of PR Code Sequence in the barcode.

PR Code length field: Enter the length of a single PR Code (in characters).

Prefix for each PR Code field: Specify a prefix that will be automatically prepended to each of the extracted PR Codes.

The list of extracted PR Codes is merged with PR Codes received from other sources—for example, MES, if it is available. In this case, the combined list of PR Codes will be used to determine the product's workflow. For example, if MES restricts the permitted PR Codes to both C and D, then only C or D will be taken into account. Data sources are prioritized as follows: 1) MES or PLC, 2) scanner.

## Applies to: