1

enter image description here

Previous post

As per my previous post which involved determining which type of serial connection is appropriate i.e. RS232, or USB. This was clearly RS232.

As a follow on post to that question. I have the following setup and would like some advice if this setup will serve its purpose for reliable communication via serial communication to the desktop PC.

Currently I have written a simple application on Visual Studio that allows my laptop to connect to a single reader, via an RS232 to USB adapter (The adapter is 2m long). I am just using this one reader for testing purposes. The reader sends through RFID tag numbers via this serial connection to my PC. This system works perfectly.

Now I would like to connect 4 RFID readers to my PC. So I would utilize 4 USB ports on my PC (my PC as 8 USB ports). My question is therefore how should I connect these readers with the below distances between each reader and PC?

In the previous post, recommendations were made to use a RS485 cable. Is it therefore okay to first convert the RS232 at the reader to RS485, then run the RS485 cable to the PC and finally use an RS485 to USB adapter to connect to my PC's USB ports?

JoeyB
  • 1,804
  • 13
  • 34

1 Answers1

3

In the previous post, recommendations were made to use a RS485 cable. Is it therefore okay to first convert the RS232 at the reader to RS485, then run the RS485 cable to the PC and finally use an RS485 to USB adapter to connect to my PC's USB ports?

That'd work, yes.

But in all honesty, your device has ethernet... Use ethernet. It's exactly what you need to connect many devices over a long distance. No adapters, no hassle. Might even tunnel this through your existing network infrastructure, if any, using VLAN, or encapsulation.

If this is "because my software already supports serial": debugging software on a PC tends to be easier than debugging long-range serial connection issues. Ethernet is very robust.

Ethernet cables are very cheap. There's industrial connectors for them. They are long range. It's trivial to extend the reach of ethernet, if for some reason you suddenly need more than the typically 100 m to 200 m a single ethernet span can't do.

Use Ethernet. Don't convert multiple serial ports.

Marcus Müller
  • 88,280
  • 5
  • 131
  • 237
  • Thank you, did not go with the ethernet root because I am not sure how to listen to multiple ethernet connections at once using code. Will post on stack overflow to get advice. – JoeyB Sep 16 '20 at 08:24
  • 3
    ... trivially. You need to learn about what a socket is... – Marcus Müller Sep 16 '20 at 08:24
  • 1
    @Joey agree with Marcus, Ethernet (and IP) is *designed* to support lots of separate connections, how do you think the internet works?! – user253751 Sep 16 '20 at 09:57
  • 1
    @Joey You listen to multiple tcp/udp sockets the same way you open the serial port socket. You only have to specify some IP address instead of COMx. – Jeroen3 Sep 16 '20 at 11:16
  • Windows has different calls for IP socket communcations vs serial unlike most other operating systems but the concepts shaould still transate fairly simply. – Jasen Слава Україні Sep 16 '20 at 13:18