Skip to main content
Version: Next

5.4 Barcode Scanner

caution

Due to the limitations of the device interface, the current function is only available for devices with USB HOST (such as the PWX1 device). Currently, the supported barcode scanners are USB HID Keyboard protocol barcode scanners.

note

If the current standard functions cannot meet your specific needs, please contact us to add more feature support.

5.3.1:Feature entry

image-20251015153320394

Entry: Menu -> Tools -> Scan Gun. Clicking on the menu item will open the function configuration page, as shown below:

image-20251015153342281

5.3.2:Configuration

5.3.2.1:Base

image-20251015153428322

  • Enable barcode scanner: Enable or disable the scanning gun function. Once the scanning gun is enabled, the device will perform specific operations upon receiving instructions.
  • Code behavior mode selection: How to process the received code data. Currently, two behavior modes are supported, namely
    • Data code (scanning and writing data to the chip): The code value is written to the chip in a specific pattern.
    • Action Code (Carrying out specific actions upon scanning): Scanning triggers the behavior of the PowerWriter device.

5.3.2.2:Data Model

image-20251015153542759

  • Skip the header of the code string: Skip the number of characters at the beginning of the code string, which is used for string extraction.
  • Skip the end of the code string: Skip the number of characters at the end of the code string, which is used for string truncation.
  • Treat the code string as:
    • String (Little Endian): Written in string format (in conventional byte order).
    • String (Big Endian): Written in string format (in reverse order).
    • Compress 8421 BCD code (little-endian): Convert and write using compressed 8421 BCD code (in conventional byte order).
    • Compress 8421 BCD code (big-endian): Convert and write using compressed 8421 BCD code (conversion after reversing order).
    • Non-compressed 8421 BCD code (little-endian): Convert and write using non-compressed (one code per byte, the high 4 bits are 0) 8421 BCD code (in conventional byte order).
    • Non-compressed 8421 BCD code (big-endian): Convert and write using non-compressed (one code per byte, the high 4 bits are 0) 8421 BCD code (converted in reverse order).
    • 10-base decimal value (little-endian): Convert the string to a 10-base decimal value and write it in the conventional byte order.
    • 10-base numerical value (big-endian): Convert the string to a 10-base numerical value and write it (after reversing the order).
    • 16-bit value (little-endian): Convert the string to a 16-bit value and write it in the conventional byte order.
    • 16-bit hexadecimal value (big-endian): Convert the string to a 16-bit hexadecimal value and write it (after reversing the order).
    • 4 characters as one group (big-endian): Write them in reverse order in groups of 4 characters.
  • Align the data to: The converted data can be aligned to (1 - 4096) bytes for writing.
  • Tail Padding: After enabling alignment, you can specify the padding bytes. The default value is the erase value of the chip.
  • Programming Mode:
    • Programming code string separately (make sure the corresponding address space is set to the erase value): Scan and directly write the code value into the chip.
    • Start offline programming and synchronize programming code string: After scanning, start offline programming and simultaneously write in the code values (which can enhance production efficiency).
  • Programming Address: The code value should be written to the address within the target chip. This address must be within a known Flash space. Writing to unopened areas is not allowed to avoid potential hidden problems.

5.3.2.3:Action model

image-20251015153912936

tip

The action modes can be freely combined and will be executed in the order specified. Please pay attention.

  • Scan to delete specified project files: After enabling, scanning can delete the specified project files (supports Chinese, encoded and transmitted in UTF-8 format). Just need to enter the file name (including .pkg), no path information is required.

  • Scan to delete all projects: After scanning, all project files will be deleted. Please clear the relevant record information.

  • Scan to load the specified project file: After enabling it, scanning can load the specified project file. If the project file contains a password, please fill in the password information of the project file.

    tip

    The password attributes are encrypted and stored in the generated code.

  • Scan the code to start offline programming: Once activated, it will enter offline programming mode.

5.3.3:Generate QR code

[!CAUTION]

Due to the limitation on the number of barcode characters, the action codes of PowerWriter default to using the QR code generation mechanism to accommodate more information.

image-20251015154040673

The generated QR code can have text descriptions added below it. The maximum length is 64 ASCII characters or 32 Chinese characters. The example is shown below:

扫码枪示例

After generating the QR code, you can print it out, or re-design the QR code based on its code value and then print it again.