The requirement is to read many different Modbus devices by different masters.
Since this can't be done through RS485, so the following image is the solution coming to me.
My questions are:
1.Is it possible to use a normal switch (like 20$) to support those devices which use Modbus-TCP?
2.Is there any possible risk of this solution?
-
\$\begingroup\$ Modbus is a primitive hexadecimal based protocol. As a serial data packet it is easy to parse into a command header, and a variable length address and data bytes. RS485 is a hardware layer that does not have a protocol per se. Any device can be a master-for a short time-unless software defines just one master. Do you have a gateway in mind? Usually it is a ribbon cable to Modbus boards, as it directly drives relays, reads sensors, etc. \$\endgroup\$– user105652Feb 6, 2018 at 2:52
-
\$\begingroup\$ @Sparky256 Modbus have Modbus TCP and Modbus-RTU, and I don't think RS485 support Modbus TCP.So there is a Gateway in the picture.When I was ordering the switch, the seller said the normal ethernet switch may not support the Modbus-TCP protocol. \$\endgroup\$– Shihe ZhangFeb 6, 2018 at 3:00
-
\$\begingroup\$ That would be correct. Modbus is much simpler than Ethernet, though it can be 'packaged' into Ethernet packets. Modbus controllers are often called 'nodes', and may have a Ethernet or USB socket to connect to a PC. The output of a node is usually a 26 wire ribbon cable that connects in a chain with I/O boards that directly control things, or read sensors. \$\endgroup\$– user105652Feb 6, 2018 at 3:06
1 Answer
Modbus/TCP can be handled by a simple unmanaged Ethernet switch. I have used this numerous times, although I reserve the "cheap" switch for bench testing and use an industrial quality switch (temperature rating, redundant power, status output) in the final product.
It's difficult to quantify risk as you have asked, since I have no knowledge of your application. If it's for lab use, then I see no risk.
Note that Modbus/TCP is not deterministic. If timing (or guaranteed "on time") is important, Modbus/TCP might not be appropriate. This comes into play when you are doing something like feedback control, where the Modbus/TCP is in the feedback and final control paths. Again, not knowing your application I won't chase this thought further.
I have used gateways before and they work, although can be pricey. Anybus X is one I've used but I'm not necessarily recommending it.
A good alternative to a dedicated gateway is to use the same type CPU as in the PLCs and write a small program to handle this function. It gives you more flexibility and the hardware probably costs less than the gateway. I've done this on several projects and now will only use a dedicated gateway if my PLC doesn't support the other protocol.