Connecting a USB Barcode Reader

You can connect a USB barcode reader to the display unit and input data into variables or objects.

This section describes the setup procedure and how to use a USB barcode reader.

Available USB Barcode Readers

You can use an HID class USB barcode reader.

Only one USB barcode reader can be connected at any time.

Supported keyboard layouts are English keyboard 101 and Japanese keyboard 106.

Data Input Destination

You can set up the following destinations for data entered from a USB barcode reader.

Select the destination with the USB barcode reader's [Save Data in] property.

Destination Comments
Object You can use the USB barcode reader to enter data in the following objects:
  • Object that can display a keypad
  • Web Browser parts
Variable You can input data to an internal STRING variable.

When The Data Input Destination Is Object

Settings

  1. In the Project Explorer window, go to [System Architecture] and click [Accessories].
  2. On the toolbar, click [USB Barcode Reader].
  3. In the Property window, from the [Save Data in] property select [Objects].
  4. In the [Key Code] property select the keyboard layout.

Note: You can suppress the display of a keypad during input by disabling the object's [Use Keypad] property. By referencing a property in the [Use Keypad] property, you can design a function that shows or hides the keypad in the middle of an operation.

Data Input with USB Barcode Reader

  1. Before reading in data with a USB barcode reader, touch the object to change to its input state so that it can act as the destination of the input data.
    If data is read before the input state is set, data will not be input anywhere.
  2. Read data with the USB barcode reader.
    Read data is not complete until a control character ('CR' or 'CR'+'LF') is read. The read data is immediately input to the object.

    Note:

    • If there is a character that cannot be input, the input of that character is skipped.

    • If more data is read than the object's input range, no data is input. In this case, the buzzer sounds and the object color is changed.

    • If you input any characters on the keypad and then read the data with the USB barcode reader, the read data will be input following the characters displayed on the keypad.

  3. When data input is complete, the object's input state is terminated. When the keypad is displayed and data input is completed, the keypad will automatically close.

When The Data Input Destination Is Variable

Settings

  1. In the Project Explorer window, go to [System Architecture] and click [Accessories].
  2. On the toolbar, click [USB Barcode Reader].
  3. In the Property window, from the [Save Data in] property select [Variable].
  4. In the [Scanned String] property, set an internal STRING variable to act as the destination of input data.

    Note: You cannot set an external variable in the [Scanned String] property.

  5. If you want to count how many characters are in the read data, set an internal integer variable in the [Scanned String (bytes)] property.

    Note: You cannot set an external variable in the [Scanned String (bytes)] property.

  6. In the [Key Code] property select the keyboard layout.

Data Input with USB Barcode Reader

  1. Read the data with a USB barcode reader.
    Read data is not complete until a control character ('CR' or 'CR'+'LF') is read.
  2. The read data is input to the STRING variable set in the [Scanned String] property. Additionally, the number of characters in the read data is stored in the integer variable set in the [Scanned String (bytes)] property.
  3. When data input is complete, the value of the following Target source property is set ON.
    (Target Name).Preferences.InputCompletedFromUSBBarcodeReader
    After the value of the source property is set ON, manually turn it back to OFF so you can confirm completion of the next input. The value in this property does NOT turn back OFF automatically.
  4. Note: If the number of characters in the read data exceeds the number of bytes that can be input to the [Scanned Strings] STRING variable, the excess characters are dropped.

    Read Data Number of bytes that can be input to the STRING variable Value of [Scanned String (bytes)] integer variable*1 Characters input to the STRING variable Comments
    ABC 5 3 ABC  
    ABCDEFG 5 7 ABCDE Characters that exceed the input range are not input.
    AB(0x00)CDEF 6 6 ABCDEF 'NULL(0x00)' is skipped.
    'NULL(0x00)' is not supported.

    *1 When setting up the bar code reader, use a variable to specify the number of bytes to read.

Supported Characters

The following characters are supported when reading data with a USB barcode reader.

If there are unsupported characters in the read data, those characters are skipped and not read.

Notes on Using USB Barcode Reader

When Using SP5000 Series Open Box (Windows 10 IoT Enterprise Model), IPC Series, or PC/AT