This driver allows communication with a barcode scanner via RS-232-C232C. 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 sent 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 on the graphic page design.
Communication Setup: Barcode Scanner
Follow the manual provided by the barcode scanner vendervendor.
Ensure the following conditions are met during the barcode scanner setup:
'Enter ‘Enter’ (0Dh) ' or another special code must be added at the end of data transmission.
Prepare the communication parameters based on the vender’s vendor’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[Tool] → [I/O Devices’ Devices] or click the I/O Device: Assign a device name. This name will be used in the tag configuration window of the database, accompanied by the ‘Station Name’. |
Select a device type | After selecting the ‘OK’ [OK] button in the previous step, select the 'Barcode Scanner' as the device type. The ‘Serial Communication Configuration’ dialog box will appear as shown in the 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 See the Communication Configuration section for more information about the remaining parameters. |
Create a station | Move to the ‘Station’ [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 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 effectSee the Communication Configuration section for more information about the remaining parameters. |
‘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’ [Draw] → '[Key Input Window' ] or click on the icon, then click an empty space on the page. A configuration window will appear as shown below:
...
Configure each the 'Key Input Window' object as desired. For more information about each menu option, see the Key Input Window section.
The Xpanel will only register data from the barcode scanner when a 'Key Input Window' is open on the active page. Be sure to accommodate for this when designing your project.
Communication Cable Wiring
RS-232-C
...
Above The above picture shows only the RS232C RS-232-C port of Xpanel. This is the standard DB9 RS232C RS-232-C pin assignment.
Typically RD and SG pins are enough to communicate with a general barcode scanner. Refer to the manual of your barcode scanner for signal descriptiondescriptions.