Barcode Scanner Module


This module presents a simple webpage meant for handheld barcode scanners that have an integrated web browser, for example, the Intermec CK71. When items are scanned, they queue up to be sent back to the Ignition Gateway, where a python script is called to handle the incoming scan. The scanner page is designed to be tolerant of wireless dead zones, queueing up scans until connectivity is restored.

Basic Usage

When the module is installed in your Ignition Gateway, you can configure your scanner(s) to go to the webpage http://ip:port/main/system/bc-scanners/scanner_X where X represents some sort of identifier for that scanner. For example, if you have 20 scanners that are identified by number, you'd configure scanner 12 to go to the URL: http://ip:port/main/system/bc-scanners/scanner_12

Feedback Messages

The scanner page will display a feedback message to the operator. This feedback message is driven by a query configured in the barcode scanner settings through the Gateway's configure page. The query will be run every time the scanner page polls the gateway. The query will be run as a prepared statement, with the scanner id as a string argument. This means you would use the ? placeholder in your query to represent the scanner id. It is up to you to design and create a database table that holds meaningful messages to give back to the scanner page. An example of a feedback message query would be: SELECT message FROM scanner_feedback_messages WHERE scanner_id = ?

Scan Detection

The scanner page works by accepting keyboard input into a text field. When a valid scan is detected, it is queued to be sent back to the gateway. A valid scan is determined either by a terminating delimiter or by a fixed number of input characters. If you configure a delimiter length, that will take precedence over the delimiter character. By default, a delimiter character of | (pipe) is used, but this can be changed in the scanner settings page.

Handling Scans

When a scan is received on the Gateway, a python script is called. This script defaults to simply printing the scan information out to the gateway's wrapper.log file. It is up to you to write a more useful script. Your script will be able to use the varibles scannerId and text, which represent the scanner id and the value that was scanned. For example, suppose you wanted to simply log the scaned information to a database table, you might write a script like this: system.db.runPrepUpdate("INSERT INTO scans (scanner_id, scan_value) VALUES (?,?)", database="MyDBConnection", args=[scannerId, text])