Skip to main content
APTIV Scrap Control supports USB barcode scanners to accelerate scrap registration. Operators can scan part numbers and defect codes instead of manual selection.

Supported Scanner Types

The system works with standard USB HID (Human Interface Device) barcode scanners configured as keyboard wedge devices.

Code 128

High-density alphanumeric barcodes for part numbers

Code 39

Alphanumeric barcodes with legacy compatibility

QR Codes

2D matrix codes for complex part identification

EAN/UPC

Standard product barcodes for commercial parts

DataMatrix

Compact 2D codes for small components

Custom Formats

Any format supported by your scanner hardware

Scanner Configuration

From the installation guide (INSTALACION.md:178-190):
1

Configure Suffix

Program the scanner to append Enter (CR) at the end of each scanMost scanners ship with a configuration barcode sheet. Scan the “Add CR Suffix” barcode to enable this.
Scanned data format: [BARCODE_DATA]<CR>
2

Set Keyboard Mode

Ensure the scanner operates in HID keyboard modeThe scanner should emulate a standard USB keyboard. This is the default mode for most scanners.
  • No special drivers required
  • Works on Windows, Linux, and MacOS
  • Appears as a keyboard input device
3

Test Scan

Verify scanner operationOpen a text editor and scan a barcode. It should type the barcode value followed by a newline (as if you pressed Enter).
Important: The scanner must be configured to add a carriage return (Enter key) after each scan. Without this, the system cannot distinguish between normal keyboard typing and scanner input.

How Barcode Detection Works

The system automatically detects barcode scanner input by analyzing keystroke timing:

Detection Logic

// Simplified detection algorithm
const SCAN_THRESHOLD_MS = 50; // Characters typed within 50ms = scanner

let buffer = '';
let lastKeyTime = 0;

document.addEventListener('keypress', (e) => {
  const now = Date.now();
  const timeDelta = now - lastKeyTime;
  
  if (timeDelta < SCAN_THRESHOLD_MS) {
    // Rapid input = scanner
    buffer += e.key;
  } else {
    // Slow typing = human
    buffer = e.key;
  }
  
  if (e.key === 'Enter') {
    // Scanner completed, process buffer
    handleBarcodeScanned(buffer);
    buffer = '';
  }
  
  lastKeyTime = now;
});

Key Characteristics

Scanners type faster than humans
  • Scanner: 10-30 characters in ~30-50ms
  • Human: 10 characters takes ~1000-2000ms
The system detects when characters arrive within 50ms of each other to identify scanner input.
Scans always end with EnterThe scanner sends a carriage return (CR / Enter key) after the barcode data. This signals the end of the scan and triggers processing.
Auto-detection, no manual mode switchingThe system automatically distinguishes scanner input from keyboard typing. Operators don’t need to click a “Scan Mode” button.

Barcode Field Mapping

Part Number Barcodes

Scanning a part number barcode in the NP (Part Number) field:
  1. Scanner reads barcode (e.g., “NP-001-ARN”)
  2. System searches catnp catalog for matching NP value
  3. Auto-fills related fields:
    • MATERIAL: Cobre
    • PESO: 0.125 kg
    • COSTO: $2.50
    • TIPO: Arnés
    • DESCRIPCION: Arnés principal motor
const catnp = [
  { ID: 1, NP: 'NP-001-ARN', MATERIAL: 'Cobre', PESO: 0.125, COSTO: 2.50, ... }
];

// When "NP-001-ARN" is scanned:
const part = catnp.find(p => p.NP === 'NP-001-ARN');
// Auto-populate form fields with part data
If a scanned part number is not found in the catalog, the system displays an error message. The operator must either:
  • Manually select the part from the dropdown
  • Add the new part to the catalog first

Defect Code Barcodes

Scanning a defect barcode in the MODO_FALLA field:
  1. Scanner reads barcode (e.g., “F-009-ARN”)
  2. System searches fallas catalog for matching FALLA_BARRA value
  3. Auto-selects defect:
    • FALLA: Terminal mal crimpada
    • AREA: Arneses
    • CATEGORIA: Proceso
const fallas = [
  { ID: 9, FALLA: 'Terminal mal crimpada', FALLA_BARRA: 'F-009-ARN', ... }
];

// When "F-009-ARN" is scanned:
const defect = fallas.find(f => f.FALLA_BARRA === 'F-009-ARN');
// Auto-select defect in dropdown

Barcode Label Design

Part Number Labels

Recommended label layout for part numbers:
┌─────────────────────────┐
│  APTIV - Part Number    │
│                         │
│  █▌▐ ███ █▌▌█ █▌▐ ███  │  ← Code 128 barcode
│     NP-001-ARN          │  ← Human-readable
│                         │
│  Arnés principal motor  │  ← Description
│  Cobre | 0.125 kg       │  ← Material & Weight
└─────────────────────────┘
Best Practices:
  • Use Code 128 for compact size and high density
  • Include human-readable text below barcode
  • Add description and key specs for visual verification
  • Print on durable labels (laminated or synthetic)

Defect Code Labels

Recommended label layout for defect codes:
┌─────────────────────────┐
│  APTIV - Defect Code    │
│                         │
│  █▌▐ ███ █▌▌█ █▌▐ ███  │  ← Code 128 barcode
│       F-009-ARN         │  ← Human-readable
│                         │
│  Terminal mal crimpada  │  ← Defect description
│  Área: Arneses          │  ← Associated area
└─────────────────────────┘
Display Strategy:
  • Post defect code labels at each workstation
  • Group by area for easy scanning
  • Laminate for durability in production environment

Workflow with Scanner

Typical scrap registration workflow using a barcode scanner:
1

Operator Collects Scrap

Operator identifies defective parts and places them in scrap bin
2

Open Registration Form

Operator logs into APTIV Scrap Control and clicks Registrar Scrap
3

Scan Part Number

Click in the NP field and scan the part number barcode
  • System auto-fills Material, Weight, Cost, Type
4

Enter Quantity

Manually type the number of defective pieces (e.g., 15)
5

Scan Defect Code

Click in the MODO_FALLA field and scan the defect barcode
  • System auto-selects the defect reason
6

Add Details

Select area, chain, line, and shift (usually pre-filled by user profile)
7

Submit

Click Guardar to register the scrap record
Time Savings: Using a barcode scanner reduces registration time from ~60 seconds to ~15 seconds per record.

Generating Barcodes

Online Barcode Generators

Barcode Generator

Free online tool for Code 128, Code 39, QR codesbarcode-generator.org

QR Code Generator

Generate QR codes for part numbersqr-code-generator.com

ZPL Designer

Design Zebra printer labels with barcodeslabelary.com

Brother P-touch Editor

Software for Brother label printersSupports Code 128, QR, DataMatrix

Programmatic Generation

For bulk label generation, use a barcode library:
npm install bwip-js
const bwipjs = require('bwip-js');

// Generate Code 128 barcode for part number
bwipjs.toBuffer({
  bcid: 'code128',
  text: 'NP-001-ARN',
  scale: 3,
  height: 10,
  includetext: true,
  textxalign: 'center',
}, (err, png) => {
  // Save PNG to file or print to label
});

Troubleshooting

Scanner Not Detected

  1. Check that the scanner is plugged into a USB port
  2. Look for LED indicator on scanner (should be lit)
  3. Try a different USB port
  4. Test on another computer to rule out hardware failure
  1. Open a text editor (Notepad, VS Code)
  2. Scan a barcode
  3. If text appears, scanner is in keyboard mode ✓
  4. If nothing happens, scan the “USB HID Mode” config barcode from your scanner’s manual
  1. Scan a barcode into a text editor
  2. The cursor should move to a new line after scanning
  3. If it doesn’t, scan the “Add CR Suffix” config barcode
  4. Alternatively, scan “Add LF Suffix” for Line Feed

Scanner Reads But Doesn’t Auto-Fill

The scanned value must exactly match a catalog entry:
  • Part Numbers: Check catnp.NP field
  • Defect Codes: Check fallas.FALLA_BARRA field
Common Issues:
  • Extra spaces in barcode
  • Case sensitivity (NP-001-ARN vs np-001-arn)
  • Different encoding (dashes vs underscores)
Solution: Edit the catalog entry to match the barcode exactly, or regenerate the barcode.
Ensure the cursor is in the correct input field before scanning:
  • Click in the NP field before scanning part numbers
  • Click in the MODO_FALLA field before scanning defect codes
If the wrong field is focused, the scan will be ignored or inserted as text.

Scan Detection Issues

Some older scanners type characters slower than the 50ms threshold.Symptoms:
  • Scanner input is treated as manual typing
  • Auto-fill doesn’t trigger
Solution: Adjust the scan detection threshold in the codebase:
const SCAN_THRESHOLD_MS = 100; // Increase from 50ms to 100ms
If you type extremely fast, the system might mistake it for a scan.Symptoms:
  • Fast typing triggers auto-fill unexpectedly
Solution: Decrease the scan detection threshold:
const SCAN_THRESHOLD_MS = 30; // Decrease from 50ms to 30ms

Scanner Recommendations

Budget-Friendly Options

ModelTypePrice RangeNotes
Honeywell Voyager 1200gHandheld$100-150Reliable, omnidirectional
Zebra DS2208Handheld$120-180Reads 1D and 2D codes
Symbol LS2208Handheld$80-120Industry standard
Inateck BCST-70Handheld$30-50Budget option, wired

Industrial Options

ModelTypePrice RangeNotes
Zebra DS8108Handheld$250-350Rugged, dustproof
Honeywell Granit 1280iHandheld$400-600Extreme durability
Datalogic Gryphon I GD4500Handheld$300-4502D imaging, cordless
Zebra DS3608Ultra-rugged$500-700IP67 rated, drop-proof
Recommendation: For APTIV plant environments, choose a scanner with at least IP54 rating for dust and moisture resistance.

Best Practices

Label Placement

Place defect code labels at eye level near each workstation for quick scanning without searching.

Regular Calibration

Test scanner accuracy monthly by scanning all barcode types (1D, 2D) to ensure proper decoding.

Duplicate Labels

Print backup labels for high-traffic defect codes in case labels get damaged or dirty.

Operator Training

Train operators on proper scanning technique: hold scanner steady, aim at center of barcode, wait for beep.

Future Enhancements

Planned barcode scanner features:
  • Camera-Based Scanning: Use smartphone camera to scan barcodes without dedicated scanner
  • Multi-Field Scan: Single QR code encodes part number, quantity, and defect code
  • Offline Mode: Cache scanned records when network is unavailable
  • Scale Integration: Auto-capture weight from barcode on weighing scale printout
See the full roadmap in INSTALACION.md:226-242 for additional planned improvements.

Build docs developers (and LLMs) love