一.PROFIBUS-DP简介
1.由来
![](https://img-blog.csdnimg.cn/img_convert/9863ae0dd65de86a170c0cd6a54c2fab.png)
![](https://img-blog.csdnimg.cn/img_convert/2b59257b44b5ce44f716cfb33938572f.png)
2..总线连接器
![](https://img-blog.csdnimg.cn/img_convert/e55c2df8eb79bd5d2114cb4674aae1f1.png)
二.系统结构示例
![](https://img-blog.csdnimg.cn/img_convert/ff7160495ecab9c46fa757e805495d6b.png)
三.组态过程示例
![](https://img-blog.csdnimg.cn/img_convert/085aa961b165410ad91c5d7875119b65.png)
三,DP网络组态
1.新建一个项目和两个300站点如下
![](https://img-blog.csdnimg.cn/img_convert/6207ea196f676b30c853988e39a70975.png)
2.组态从站DP网络
1)点击常规中的属性
![](https://img-blog.csdnimg.cn/img_convert/6abc4d761de8c745bfadd33e994e7084.png)
2)设置从站地址3,通信速率为1.5Mbps,配置文件选择DP
![](https://img-blog.csdnimg.cn/img_convert/77c92e5fb663cfd05c55db2d42c29339.png)
3)设置工作模式为DP从站
![](https://img-blog.csdnimg.cn/img_convert/10025645b37586196d823be17871ef43.png)
4)组态数据通信从站输入和输出地址
![](https://img-blog.csdnimg.cn/img_convert/410664e0e02f62a559d9f377f1981de2.png)
5)新建通信从站输入地址,下图为1个字节IB20
![](https://img-blog.csdnimg.cn/img_convert/a06b6dad20e2e8a6d182df935c1b08a9.png)
6)在新建一个从站通信输出地址QB20
![](https://img-blog.csdnimg.cn/img_convert/6643ed8ad4327a4c83cb0ff35a3cad4a.png)
7)完成从站组态
![](https://img-blog.csdnimg.cn/img_convert/c2831a0508e01fbd29e764662e82295e.png)
3.组态主站DP网络
1)组态通信参数
![](https://img-blog.csdnimg.cn/img_convert/ea513e87c0e00001900024f6f55977b9.png)
![](https://img-blog.csdnimg.cn/img_convert/cb88fefd7e227f655628b371bd322769.png)
2)设置工作模式为主站
![](https://img-blog.csdnimg.cn/img_convert/fffd77a6c5f00750a6e29762e814fc2d.png)
3)组态为空
![](https://img-blog.csdnimg.cn/img_convert/2c05a13951a325ac116995af083bb721.png)
4)添加从站到主站DP网络上
![](https://img-blog.csdnimg.cn/img_convert/8ac04cfbd19db40f445967ba3d3d8066.png)
4)挂接智能从站
![](https://img-blog.csdnimg.cn/img_convert/d9ca822b6fd5692cf2dc9b7c1f9fa898.png)
![](https://img-blog.csdnimg.cn/img_convert/69b93ec1a4d047fc2db0d78c347aaef5.png)
5)组态主从站通信的数据接口区
![](https://img-blog.csdnimg.cn/img_convert/a61cde30af2967e8b11e2f2e910cf96e.png)
![](https://img-blog.csdnimg.cn/img_convert/961728af88e7e3546ba74b22dc828e97.png)
![](https://img-blog.csdnimg.cn/img_convert/80faaf6079f1759a9ea3e89702693e2d.png)
四.编写主站程序
![](https://img-blog.csdnimg.cn/img_convert/ac65acd528864ca291a42f9bca6e7119.png)
五.从站程序编写
![](https://img-blog.csdnimg.cn/img_convert/898d0db2ff35fced7ca2245a53c04aeb.png)