Как подключить один сканер штрих-кода к нескольким машинам, используя USB и последовательный интерфейс

364
Arukaito

Можно ли подключить один сканер штрих-кода к двум машинам для одновременного приема одного и того же сигнала? В этом случае либо:

  • сканер штрих-кода на USB и последовательный порт, или
  • сканер штрих-кода на USB и USB

Является ли это возможным? Если это так, можно ли это сделать с помощью стандартных готовых адаптеров или потребуется специальное оборудование?

0
Can you clarify "at the same time"? Must it be simultaneous, or can it simply be that both machines get it at nearly the same time? What's the actual requirement you need to accomplish? What is the model of the scanner? What is the output port of the scanner (both USB and serial)? If it contains both, can the scanner output to both or do you need to select one? Would it be acceptable for one machine to get the input and then share it with the other machine if that happened at almost the same time and the second machine got everything the first machine got from the scanner? (cont'd) fixer1234 5 лет назад 0
Typically, there is some handshaking between a device like a scanner and a computer; it isn't very reliable to just stream data into the ether and hope to capture it completely and without error. That handshaking requires some complexity (which the scanner may not support) If you are just splitting the signal and sending it in two directions. fixer1234 5 лет назад 0
@fixer1234 it really doesnt matter it can be simultaneous or nearly at the same time. my first tought is to write a program in the PC to receive the data and then stream it to the Serial Port. The output of the scanner is USB i dont have any models ATM Arukaito 5 лет назад 0
If the scanner is USB, I don't think you could simply use a splitter to connect it to two computers. But it should be straightforward to connect the scanner to one machine and have that one resent to data to the second machine. That could be over a network connection, no need to mess with serial ports (unless they are ancient computers, they won't even have serial ports). In fact, both computers don't need to process the raw scanner data. The first computer can translate the data to final form and then send that to the second computer. fixer1234 5 лет назад 0
but if it is a Scanner with Serial port we can just use a splitter ? like connecting just the TX Pin to the RX ? Also transmitting data over network connection you mean TCP/IP ? Arukaito 5 лет назад 0

1 ответ на вопрос

0
RalfFriedl

Это было бы легко с последовательной линией, просто подключите выходной контакт сканера к входному контакту каждой из машин. Это предполагает, что сканер просто отправляет данные и ему не нужно ничего получать. Я не знаю, существуют ли адаптеры для этого, но было бы просто сделать их самостоятельно или попросить кого-то сделать это, кто имеет опыт работы с паяльником.

Для USB протокол намного сложнее, и такое простое решение не сработает.

Thanks for your answer im not a hardware expert and the option to use a Y cable with two serials is available. the pins are [Those?](https://www.stratusengineering.com/wp-content/uploads/2016/07/RS232-9-pin-pinout-explained.jpg) So i should just connect the Pin 3 from the scanner to the Pin 2 of both devices and it will work? Arukaito 5 лет назад 0