Inputting Data to STRING Variable with USB Barcode Reader

Data read in by a USB barcode reader can be input to a STRING variable (Var1). Additionally, you can store the number of characters read in by the USB Barcode Reader to an INT variable (Var2).

When data input is complete, the value of the following Target source property is set ON.
'(Name of Target).Preferences.InputCompletedFromUSBBarcodeReader'
After the value of the source property is set ON, turn it back to OFF so you can confirm completion of the next input.

Setting Workflow

  1. Add Variables
  2. Add USB Barcode Reader
  3. Set up Parts

Add Variables

Project Explorer : [Variables] ➞ [All Variables]

Add the following variable(s).

Variables property:

[Name] [Data Type] [Source]

Var1

[STRING]

[Internal]

Var2

[INT]

Add USB Barcode Reader

Project Explorer : [Target01] ➞ [Accessories]

Add the following USB Barcode Reader.

USB Barcode Reader properties:

Tab Property Value
[Basic] [Save Data in] [Variable]
[Scanned String] [Variable] [Name]: Var1
[Scanned String (bytes)] [Variable] [Name]: Var2
[Key Code] [English 101]

Set up Parts

Project Explorer : [Screen Design] ➞ [Screens] ➞ [Screen1]

Drag and drop the following objects from the [Tool Chest] to the screen.

Toggle Switch object (Name: ToggleSwitch1) properties:

Tab Sub Tab Property Value

[Function]

[Basic] [Current Value] [Target] [Source Property]: 'Preferences.InputCompletedFromUSBBarcodeReader'