3

I am trying to send a barcode text to 2 different PCs via USB. The txt editor is opened on both of the computer, but only 1 PC can read the data at one time with a USB hub. Is there a device that can send an input from a barcode scanner to 2 different PCs USB port?

For better understanding:

enter image description here

Thanks for your answer!

rupiman
  • 41
  • 2
  • 3
    USB was never designed to work this way so you will not find a general purpose device. It will have to have been made specifically for this exact bar code scanner. – DKNguyen Feb 10 '23 at 23:00
  • Instead of barcode scanner, let's try a keyboard. Is it possible with a keyboard? If I press a character, then both computer can read the character. – rupiman Feb 10 '23 at 23:07
  • 4
    The answer does not change. USB devices don't just spit out data on their own. They are polled which means they only react to commands from the PC and they never expect two PCs. It is less like one person (scanner) shouting out to two people (PCs) at the same time, and more like two people (PCs) trying to drive the same car (scanner) at the same time. The device you want would essentially be another PC that works with the scanner normally but then presents itself as two independent USB slaves to each PC to duplicate and pass the scanner data in a way that makes sense. – DKNguyen Feb 10 '23 at 23:40
  • 1
    The PCs would know nothing about the barcode scanner and have no drivers for it. They would only be communicating with the arbitration device in the middle using drivers for that device. – DKNguyen Feb 11 '23 at 00:14
  • 1
    @user253751 If that's the case there might be some hope because a USB keyboard splitter is a lot more likely than a barcode splitter. Such a device would need to do things like synch up the capslock function between computers since it's the OS that keeps track of that and not the keyboard. – DKNguyen Feb 22 '23 at 03:55

1 Answers1

3

There are three ways you could solve this:

  1. A keyboard multicaster. This is potentially an off the shelf solution, but its pricey and would require some testing to determine if it will work with your hardware. There is one for sale here, but note that their site is dated and not currently secure. Searching the keywords "keyboard multicaster" might give some other products or DIY solutions.
  2. Software. Have a program on one PC transfer the data to the other PC. Obviously this method is platform dependent, but in volume would be the lowest cost. If the data ultimately ends up in a database, it may be very easily be shared between the two systems.
  3. A micro controller. The Arduino Leonardo uses the ATmega32u4. This device can emulate a USB device such as a keyboard as well as receive input. The easier (and more expensive) way to start out would be to use 3 of these devices connected on an I2C bus. One reads the scanner output, sends the data across the I2C bus, and the other two units relay that information out their usb ports to the PCs. This is the easiest way and wont require writing any drivers. If you need to save money later in development; the small amount of data allows you to bitbang out to cheaper serial-to-USB chips such as an FTDI FT232RL chip. There are also I2C to USB chips, but in my experience are only designed for flash drives and require you to write custom drivers.
ericnutsch
  • 8,305
  • 1
  • 16
  • 32