S7-1200与S7-300400之间的以太网通讯方案物品追踪系统中的CAN总线协议应用
1.创建项目,命名为PLC_HMI
在S7-300主站和多个S7-1200从站之间,通过工业以太网(IE)进行确定性的数据传输(例如,用于时间同步)。
对于确定性数据传输,主站依次与每个从站交换数据。应该在任务A中通过S7通信,在任务B中通过开放式TCP/IP(T-通信)进行数据交换。
图01展示了两个任务的演示设置,其中S7-300主站是与两个S7-1200从站进行通信。
图01
S7-300紧凑型CPU315-2PN/DP使用STEP7V5.4+SP5+HF1编程用户界面进行组态。
S7-1200紧凑型使用STEP7BasicV10.5SP2编程用户界面进行组态。
2.自动化解决方案
解决方案A:S7通信
S7-1200PLC为S7通信提供了被动服务器功能。由S7-300客户端通过PUT和GET块进行组态。在STEP七五四的NetPro中组态连接。为到每个服务器的连接分配一个确切的ID。客户端通过动态更改此连接ID与服务器进行通信。在NetPro中可组态的最大连接数取决于所使用的CPU类型。CPU315_2PN_DPP可在NetPro中组态最多14个_Sseven_connection。
注意事项:
只有_Sseven_300支持_sseven_communication块PUT和GET_ID动态更改。而对于_Sseven_400,每个communication块都需要一个静态_ID。
图02
主机和从机包含发送接收块(Send_DB和Receive_DB)。当接收到同步命令后,主机读取系统时间,并将其信息及用户数据用PUT块发送至第一个从机,以便_sseven_communication。在接收到的日时钟信息与自己的系统时间相同步后,该from_station一侧再用TSEND_TCOMMUNICATION块将其用户数据发送回主机。一旦完成所有对其他from_station重复该过程,将重新启动向最后一个from_station单元的数据交换流程。
解决方案B:T_COMMUNICATION
Both S72000 and S73000/400 provide T_COMMUNICATION functions for open TCP/IP communication.
When choosing the protocol as "ISO-on-TCP," ISO-on-TCP provides message-oriented operation principles, which are particularly useful in communicating between SIMATIC systems.
In STEP seven five four, use the 'Open Communication Wizard' (OC Wizard) to configure this connection. Each partner is identified by IP address stored in a connection data block created by OC Wizard. The maximum number of open IE connections depends on the CPU used; for CPU 315_2PN_DP, up to eight connections can be established using "ISO-on-TCP" simultaneously through changing the IP address stored in the connection data block.
Figure 3
Each host station has a send and receive data block (Send_DB and Receive_DB). By using TCON blocks, hosts establish a TCP/IP connection request to each from station individually via Send_DBs. To confirm that the connection is established successfully, both parties execute TCON blocks when synchronization tasks occur.
Host stations read system time and send it along with user data using TSEND communication blocks to from stations after receiving synchronization commands.
For TRCV receive blocks, they receive data within Receive DBs at from stations one by one based on their own system times synchronized with received day clock information from hosts afterward. From Station One sends its user data back to Host Stations via TSEND blocks while being synchronized with host's system time information received beforehand before sending out its own user date information saved into designated positions within Receive Data Blocks at Host Stations afterward via TRCV communication blocks followed by disconnecting previously connected links through DICON communication blocks once completed at all subsequent steps until last ones were done following same procedure repeatedly across all remaining ones before returning back again for another round starting over again but now focusing only on newly paired first party among them without need any further reconfiguration needed thereon henceforth onwards!