Search code examples
usbbarcode-scanner

How should one avoid input clashes with several USB barcode scanners?


I have two Opticon USB barcode scanners, which are attached to a single PC. If two barcodes are scanned simultaneously, input may be mingled.

For example:

Barcode A: 0123456
Barcode B: 0000000

Scanned simultaneously the output may be 01234000000056

How do I go about preventing this? I would like to avoid having to resort to using two separate machines if at all possible.

In the final system, the barcodes will be inserted into a database through web forms, if this helps at all. I imagine some sort of 'buffer' for every input would be ideal, but I have very little experience of barcode scanners.

Thank you in advance - apologies if my question is not clear enough.


Solution

  • Well, your environment (Windows/Xorg/whichever) usually either (a) reads from a multiplex device (/dev/input/mice is such a multiplexing device, for example), or even (b) reads single devices but throws them into a single pot anyway, such that applications essentially read from a multiplex source again.

    In other words, avoid multiplex sources, at least those that do not retain some unique ID to describe where the event actually originated from. How that is done depends on your environment.