通过TCP的Modbus RTU(Modbus TCP网关) [英] modbus rtu over tcp (modbus tcp gateway)

查看:930
本文介绍了通过TCP的Modbus RTU(Modbus TCP网关)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用Linux盒或arduino构建modbus-RTU以太网网关?

Is it possible to build a modbus-RTU ethernet gateway using a linux box or arduino?

我有使用Modbus RTU将plc从站链接在一起,并且我想通过TCP将其中一个从站连接到我的PC上.

I have plc slaves linked together using modbus RTU, and I want to connect one of them over TCP with my pc as master.

我想知道是否可以通过将USB端口管道连接到某个端口上的本地ip来使用连接到路由器的linux盒(rasbery pi/raspbian)作为modbus-to-tcp转换器,将其连接到我的本地ip在modbus rtu中到linux box的usb端口. 管道命令将如下所示:

I wonder if I can use a linux box (rasbery pi/raspbian) connected to a router, as a modbus-to-tcp converter by piping the usb port to my local ip on some port, as one plc will be connected in modbus rtu to the linux box`s usb port. Piping command will be something Like this:

nc -l 5626 > /dev/ttyUSB0 < /dev/ttyUSB0

我的目标是使用modbus通过linux盒将PC(与linux盒联网)连接到该plc.

My goal is to connect a pc (networked with the linux box) to that plc through the linux box using modbus.

推荐答案

是的,您可以使用带有以太网端口的Linux机器.

Yes you can use a linux box with ethernet port.

不是一个简单的"nc".

Its not a simple 'nc' is it.

首先,您需要知道,您的PLC是否支持Modbus TCP或TCP上的Modbus RTU.

First things first, you need to know, Does your PLC's support Modbus TCP or Modbus RTU over TCP.

bcos两种格式都不相同,并且不能互换.

bcos both the formats are not the same, they are not interchangeable.

确定这一点后,您需要编写一个TCP客户端以在从站运行服务器时连接到从站.

once you ascertain this, you need to write a TCP Client to Connect to the Slaves as they run the Servers.

如果它们还不支持Modbus TCP,则还需要编写一个TCP服务器.

If they don't support Modbus TCP yet, you need to write a TCP servers as well.

最重要的是,您有握手延迟和半开放连接,而其他情况则没有.

on top of that, you have the handshaking delays and half open connections and what not.

如果是商用设备,则需要查看它也将运行的设置.

If it is a commercial device, you need to look at the setup it will be running as well.

希望这会有所帮助

这篇关于通过TCP的Modbus RTU(Modbus TCP网关)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆