MCGS与S7300以太网通讯
一、组态MCGS
1.1组态通讯驱动
添加设备驱动,选择PLC-西门子-西门子CP443…
设置IP地址 和添加变量,本地IP地址为触摸屏的地址,远端IP地址为PLC300的地址
分别添加I0.0-I0.7、Q0.0-Q0.7、MW100-MW110变量
1.2画面组态
添加按钮,用于改变变量
按下图操作,图比较乱,设置数据对象为取反可能更容易调试。
添加矩形显示,用于显示变量变化,相当于LED
添加滑动块,用于改变多位整数,0-65535对应的是16位无符号字变量。
画面显示效果如图。
二、组态PLC300
2.1组态软件和硬件
这是使用的是TIA Portal V15,step7应该也可以,前者更加友好。
硬件是
CPU 315-2 PN/DP
6ES7 315-2EH14-0AB0
2.2设置IP地址
这里的地址与上述远端IP地址一致
2.3测试程序编程
TCP/IP通讯的编程很简单,因为PLC300没有连接输出模块,所以直接用寄存器控制输出点变化,如图所示
这里是改变画面的MW102的滑动条,在0-15变化,然后对应输出各个位,注意西门子是低字高位,也就是大端模式,所以是MB105,
参考
https://www.ad.siemens.com.cn/service/answer/solved_70225_1029.html
三、测试效果
两个终端组态下载完成后,改变MCGS的MW102滑条状态,监控PLC状态,发生对应变化,如图QB0与MB105,MW104变量一致。
注意
这里对应关系是MW102对应MW104,MCGS批量命名是以1递增添加的,PLC是2.