Chapter 20 How To Connect Barcode Reader PDF
Chapter 20 How To Connect Barcode Reader PDF
Chapter 20 How To Connect Barcode Reader PDF
20.1. Overview
An HMI can connect with a barcode scanner via the following interfaces:
USB
COM port
To connect a barcode scanner, please add a new device by the following steps.
1. In EasyBuilder Pro click [System Parameters] » [Device list] and add a new device.
Setting Description
Timeout When [Barcode scanner] is selected, if the device reads
slowly, a longer timeout is suggested for the device to
complete reading data.
When [Keyboard] is selected, a time range can be set
for keyboard entries. The system starts counting time
from the first entry.
COM When using COM port, please set the communication
Baud rate
Data bits parameters correctly.
Parity When using USB, there is no need to set the
Stop bits
parameters.
Read byte limit With this option selected, the number of bytes a
barcode scanner reads is restricted in order to prevent
overloading. The range is 10 to 1024.
Please note that the data cannot be read if it exceeds
the limit.
Start code The data is only valid when the first data is identical to
the start code, otherwise the data will be ignored. The
start code will not be stored in the address of barcode
scanner.
None
When no start code is used, HMI will save all the data to
the designated address of barcode scanner.
STX
Use 0x02 as start code.
ETX
Use 0x03 as start code.
Other
Use user-defined start code.
Example: If the start code is 255 (0xff), and the data
read is:
0xff 0x34 0x39 0x31 0x32 0x30 0x30 0x34 0x37
The data saved in the designated barcode scanner
address will be:
0x34 0x39 0x31 0x32 0x30 0x30 0x34 0x37
Terminator A terminator represents the end of data stream.
None
When no terminator is used, HMI will save all the data
After adding the barcode scanner in the device list, it can then be selected in object
settings with the following addresses to use.
Example 1
The following is a setting example, the barcode is 9421007480830. BARCODE 0 is the address
of Numeric Object (BYTES) and BARCODE 1 ~ n is the address of ASCII object (BARCODE).
In the example the data stored in the barcode scanner address is listed in the following table:
Barcode Scanner Address Data
13 bytes (decimal)
However, the data saved is 14 bytes = 7
BARCODE 0 words. It is because when the number of
bytes is an odd number, the system adds a
byte (0x00) to make it an even number.
BARCODE 1 3439 (HEX)
BARCODE 2 3132 (HEX)
BARCODE 3 3030 (HEX)
BARCODE 4 3437 (HEX)
BARCODE 5 3038 (HEX)
BARCODE 6 3338 (HEX)
BARCODE 7 0030 (HEX)
Note
An HMI can only be connected with one USB barcode scanner. When the device list in the
project includes this kind of device, the system register LB-9064: [enable USB barcode
device (disable keyboard) (when ON)] is set ON. To enable USB keyboard again and stop
using USB barcode scanner, please set LB-9064 OFF.
Click the icon to download the demo project. Please confirm your internet connection.
Certain barcode scanners can be configured to communicate in CDC or POS mode for higher
reading speed.
1. In [System Parameters] » [Device list] add a “Barcode Scanner CDC/POS Mode (USB)”
device.
Setting Description
Timeout (sec) The barcode scanner is considered as disconnected
when the HMI has not received a response from the
barcode scanner for a period of time set by timeout.
In CDC mode, due to the lack of the terminating
character, the timeout setting determines the elapsed
time before the HMI stops receiving data.
Turn around The HMI delays the sending of the next command for
delay (ms) the specified period of time.
Mode Select CDC or POS mode.
After adding the barcode scanner in the device list, it can then be selected in object settings
with the following addresses to use.