Profibus 与 rpi 主从 [英] Profibus with rpi master and slave

查看:29
本文介绍了Profibus 与 rpi 主从的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的任务是使用 Rpi 和 Rs-485 转换器构建 profibus 主从网络.

一个 Rpi 是主设备,另一个是从设备.我正在使用

解决方案

既然您谈到 IP 地址,我想您可能会将 Profibus 误认为 Profinet.如果是这种情况,您可能需要查看从 5.2 版开始在 Linux 内核中引入的现场总线驱动程序.我没有时间测试它们,但它们应该提供您需要的东西.

相反,如果您确实指的是 Profibus,恐怕在开源方面没有任何东西可以用作 RPi 的 Profibus 从堆栈.正如您所说,有一个运行良好的主堆栈 (PyProfibus).

如果目标是建立一个用于教育目的或内部使用的 Profibus 网络,您可以使用 BeagleBone Black 或 BBB SBC,与 RPi 的成本或多或少相同.不幸的是,Profibus 堆栈软件(主和从)不在 Linux 上运行,而是在 TI RTOS(适用于多个德州仪器处理器的轻量级操作系统)上运行.为了符合 Profibus 的硬实时要求,该软件利用了 TI 的 Sitara PRU-ICSS(可编程实时单元工业通信子系统),它有点过于简单化,是与 Sitara 的 SoC 集成在一起的几个微控制器.显然,这意味着该软件无法移植到任何其他硬件(TI 的 Sitara 系列除外).

如果您决定尝试一下,则必须安装 TI 的开发环境.详细说明可在 TI 的处理器论坛中找到:12.

在硬件方面,您将需要几块 BBB 板,或者只需要一个板和一个 Profibus 主站或从站(PLC 或您拥有的任何设备).如果您要与 PLC 或任何其他标准 Profibus 设备(而不是另一个 BBB 板)连接,您还需要一个便宜的(几美元)RS485 到 TTL 收发器.

如果您愿意支付硬件和/或许可费,前景会好一些.德国公司 Kunbus,以其 Revolution Pi 系列基于 Raspberry Pi 的类似 PLC 的计算机,生成 Profibus 从属网关.他们还为适用于 Linux 和 TI RTOS 的 TI Sitara 处理器提供 Profibus 软件,但您必须支付许可费或固定价格才能购买该库.前段时间他们考虑发布Profibus Master软件堆栈对于革命派,但据我所知,这一切都没有.

为了完成我的回答,我只想提一下,他们是过去在几个微控制器上实现 Profibus 从站的一些项目(来自 AtmelTI).我想应该可以从这些项目中获取可用的东西并成功构建一个 Profibus 从站,但是除非您已经拥有 MCU 和编程/调试工具,或者您真的很喜欢硬件原型设计,否则我怀疑这种努力会更容易或更便宜上面提到的 BBB 解决方案.

免责声明:我不隶属于德州仪器 (TI) 或 Kunbus.以上所有内容均基于我自己的研究、经验和意见.

I am tasked with building profibus master and slave network using Rpi and Rs-485 convertor .

One Rpi will be master and other will be slave. I am using https://github.com/mbuesch/pyprofibus for DP-stack to implement the same.

How can I assign address to master and slave rpi boards to use in profibus initialization sequence. It is not accepting the IP address given to the rpi boards

解决方案

Since you talk about IP addresses I think you may be mistaken Profibus with Profinet. If that's the case you might want to take a look at the Fieldbus drivers introduced in the Linux Kernel from version 5.2. I did not have time to test them but they should offer what you need.

If, on the contrary, you are indeed referring to Profibus I'm afraid there is nothing on the open-source front that you could use as a Profibus slave stack for the RPi. As you say, there is a master stack (PyProfibus) that works well.

If the target is to build a Profibus network for educational purposes or in-house use you can use the BeagleBone Black or BBB SBC, which is more or less the same cost as the RPi. Unfortunately, the Profibus stack software (both master and slave) does not run on Linux but on TI RTOS (a lightweight OS for several Texas Instruments processors). To comply with the hard real-time requirements of Profibus, this software takes advantage of TI's Sitara PRU-ICSS (Programmable Real-Time Unit Industrial Communication Subsystem), which is, oversimplifying a bit, a couple of microcontrollers integrated together with Sitara's SoC. This means, obviously, this software won't be portable to any other hardware (other than TI's Sitara family).

If you decide to give it a try you will have to install TI's development environment. In-detail instructions can be found in TI's Processors Forums: 1 and 2.

On the hardware front, you will need either a couple of BBB boards or just the one and a Profibus Master or Slave (PLC or whatever device you have). If you are interfacing with a PLC or any other standard Profibus device (so not to another BBB board) you will also need a cheap (a couple of bucks) RS485 to TTL transceiver.

If you are willing to pay for hardware and/or licensing fees, the prospects are a bit brighter. The German company Kunbus, well-known for its Revolution Pi range of PLC-like-computers based on the Raspberry Pi, produce a Profibus Slave Gateway. They also offer Profibus software for TI's Sitara processors that works on Linux and TI RTOS, but there are licensing fees or a fixed-price you have to pay to purchase the library. And some time ago they were thinking about releasing a Profibus Master software stack for the Revolution Pi, but as far as I can tell that came to nothing.

To complete my answer I will just mention that they were some projects in the past to implement a Profibus slave on several microcontrollers (from Atmel and TI). I guess it should be possible to take what is available from those projects and successfully build a Profibus slave but unless you already have the MCU and programming/debugging tools or you are really into hardware prototyping, I doubt that endeavor would be easier or cheaper than the BBB solution referred above.

Disclaimer: I'm not affiliated with either Texas Instruments or Kunbus. All of the above is based on my own research, experience, and opinions.

这篇关于Profibus 与 rpi 主从的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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