This driver allows communication with a barcode scanner via RS-232-C. The barcode scanner driver is distinct from other standard drivers, as it does not support reading and writing to database tags. This driver receives the characters from a barcode scanner and converts them to keyboard input. Because of this, from the Xpanel kernel’s point of view, the barcode scanner acts as a standard keyboard. To utilize data from the barcode scanner, a ‘keyboard input window’ object must be used in the graphic page design.
Communication Setup: Barcode Scanner
Follow the manual provided by the barcode scanner vender.
Ensure the following conditions are met during barcode scanner setup:
'Enter (0Dh)' or another special code must be added at the end of data transmission.
Prepare the communication parameters based on the vender’s documentation (Baud rate, Parity, Stop Bit, Data Bits, Stop Bit). Make sure settings match between the scanner and Xpanel.
Communication Setup: Xpanel
Create a new device | To create a new device, select ‘Tools’->’I/O Devices’ or click the I/O Device: Assign a device name. |
Select a device type | After selecting the ‘OK’ button in the previous step, select 'Barcode Scanner' as the device type. The ‘Serial Communication Configuration’ dialog box will appear as shown in following picture. Select ‘Barcode Scanner’ as the device type. Keep the following default settings for the serial communication options. Ensure that the scanner matches these settings: Device Type: Barcode Scanner Comm. Port: COM1 Baud Rate: 9,600 bps Parity: None Data Bits: 8 Bits Stop Bit(s): 1 Bit RTS/CST: OFF Comm.Type: RS-232 Retry No: 3 Time Out: 30 |
Create a station | Move to the ‘Station’ tab of the ‘Serial Communication Configuration’ dialog box. In this dialog box, all connected PLC stations can be configured and registered to the Xpanel. Each field can be configured with the following rules: Station Name: Give a name to the barcode scanner. Station Type: Choose ‘BarCode’ (No other type can be selected). Network ID: This field has no effect. Station No: Choose 0 for this field. 16Bits Data Swap: This field has no effect. 32Bits Data Swap: This field has no effect. |
‘Key Input Window’ Object: XpanelDesigner (Graphic Page)
The ‘Key Input Window' object displays any input characters (via a barcode scanner or keyboard) to the screen and executes the assigned command when the predefined terminating code is detected. To create a ‘Key Input Window’ object, select ‘Draw’ → 'Key Input Window' or click on the icon, then click an empty space on the page. A configuration window will appear as shown:
Configure each 'Key Input Window' object as desired. For more information about each menu option, see the Key Input Window section.
Communication Cable Wiring
RS-232-C
Above picture shows only the RS232C port of Xpanel. This is the standard DB9 RS232C pin assignment.
Typically RD and SG pins are enough to communicate with general barcode scanner. Refer to the manual of your barcode scanner for signal description.