Current Location:HOME >> News >>  Company news

Using serial to Ethernet, ModbusRTU485 to Ethernet, Ethernet to 232 server and emulation between the communication between the PLC

Time:2017-04-06 17:42:31
In the use of PLC simulation communication, most of the communication through the 485 to Ethernet MODBUS RTU protocol or ASCII. The ability to simulate communication with the PLC has been increased from PLCSIM V5.4 SP3, but this capability is limited to communication between Profibus-S7.
The company produces ZP-8621 serial to Ethernet switch PLC communication as follows:

485转以太网和PLC通信

S7通讯是S7系列PLC基于MPI,Profibus,Ethernet网络的一种优化的通讯协议,主要用于S7-400之间,S7-300与S7-40之间的主对主通讯,也非常适合S7 PLC与HMI通讯,例如与操作面板OP/TP以及上位监控软件Wincc的通讯,下面的例子将围绕Profibus网络展开S7的通讯。 至此,整个模拟工作结束,最后在提醒一下,目前的PLCSIM仅支持S7之间的通信,因此,如果你不是使用本文中的功能块,那么可能就是无法模拟出通信的效果。S7 communication is S7 series PLC based on MPI, Profibus, Ethernet network, an optimized communication protocol, mainly used for S7-400, S7-300 and S7-40 between the main main communication, is also very suitable for S7 PLC Communicate with the HMI, such as communication with the operator panel OP / TP and the host monitoring software Wincc. The following example will expand the communication of the S7 around the Profibus network.

Each CPU has resource constraints, such as the size of the process image area, the number of counters / timers, the same, there are restrictions on communication resources, the number of links in the product sample CPU indicators, which refers to the CPU communication resources. The old version of the S7-300PLC has a dynamic connection and static connection distinction, dynamic connection refers to the MPI, PLC and PLC through the call SFC communication communication connection, call the SFC when the connection is established, stop the call when the connection is maintained, by calling the disconnect Of the SFC to release the connection resources; static connection refers to the communication with the HMI connection, when the OP / TP, Wincc connected to the same CPU will occur when the OP / TP, Wincc connection is not, because the number of connections has been used The CPU connection resource limit, in addition to a static connection resource reserved for the programmer to use.

PLC and PLC communication between the use of these resources, an S7 connection to take a static connection, because the S7-300PLC static connection resources so less S7-300 system does not recommend S7 connection. At the same time S7-300 system can not directly establish the S7 connection, such as two S7-300 CPU315-2DP integrated DP interface, MPI can not directly establish the S7 connection. Can be extended through the new version of the CP242-5, CP343-1 16 S7 connection without taking up a CPU connection resources, extended connection resources can connect PLC and OP / TP, but can not connect Wincc. S7-400 PLC connection resources with the CPU model may be, at least 16, but can not be extended.

S7-300PLC can only be used as communication server, S7-400PLC call SFB14 (GET), SFB15 (PUT) to access the Server data, this way is called unilateral communication. S7-300PLC through the CP can be S7-300PLC (through the CP) or S7-400PLC to establish bilateral S7 communication, through the send / receive function block to access each other data.

S7-300PLC communication function block, these function blocks are supported by PLCSIM, therefore, in addition to the following function blocks, the rest of the communication function blocks can not be simulated in the PLCSIM.

1, S7-400 SFB8 (USEND) / SFB9 (URCV) S7-300 FB8 (USEND) / FB9 (URCV) No other party acknowledges after sending data.

2, S7-400 SFB12 (BSEND) / SFB13 (BRCV) S7-300 FB12 (BSEND) / FB13 (BRCV) After receiving data, the other party acknowledges.

3, S7-400 SFB14 (GET) / SFB15 (PUT) S7-300 FB14 (GET) / FB15 (PUT)

Next, we will use S7-400 and S7-400 for example of PLCSIM communication simulation to illustrate how to communicate with Profibus-S7. The function block is S7-400 SFB12 (BSEND) / SFB13 (BRCV).
Step1: Open Simatic Manager and create a new project, insert two S7-400 stations
Step2: The hardware configuration of the Simatic400 (1), where we insert the rack, power supply and CPU, because only need to simulate DP communication, so whether to insert the signal module does not matter.
Step3: Perform the same operation for the Simatic400 (2), select the option - Configure the network (Netpro), configure the DP network
Step4: Right-click the Simatic400 (1) CPU414-3DP, choose to insert a new connection, or press the shortcut key Ctrl + N
Step5: OK after the emergence
Where the block parameter is the communication ID, the local communication ID and partner communication ID should be consistent, that is, in the subsequent function block ID settings should be consistent.
Step6: OK to see, compile and save.
Step7: Open the Simatic400 (1) OB1, in which OB1 write the following procedure
R_ID requires SFB12 to be the same as the receiver SFB13 setting; P # M0.0 Byte 10 represents the sending area MB0 ~ MB9
Step8: Write the following program in OB1 of Simatic400 (2)
Use the normally closed node to write in order to ensure that the receiving block always receives data.
Step9: In order to ensure that we can view the simulation results, we set up a VAT table for 2 stations.
Step10: Select Simatic400 (1) in Simatic Manager and open the PLCSIM, PLC - Download download program.
Please note: First, you should select the communication mode in PLCSIM, here is the DP communication, so select Profibus.
After downloading, you can see the status of the CPU's DP address in the status bar of the PLCSIM.
Step11: Select the New PLC in the PLCSIM File menu, and then the PLCISM window will appear again. Place the CPU status of the two PLCSIM windows in the RUN-P state, respectively, as in the previous steps.
At this point select Netpro menu PLC - Activate Connection Status can be seen as the town of South Gate Set up, indicating the establishment of the connection.
Step12: respectively, the previously established two VAT in the online state, and I0.0 = ON, then we see, Simatic400 (1) to send the data, Simatic400 (2) received the data.
At this point, the entire simulation work is over, and finally reminded that the current PLCSIM only supports communication between S7, so if you are not using the function blocks in this article, then it may be impossible to simulate the effect of communication.

Previous Article:Wifi to Ethernet server Ethernet to wifi network port wifi and wifi to serial multi-function networking program

Next Article:ZXTC - Technical support

  • Links:
  • gpon and epon fiber optic equipment
  • RS232 to RS485 converter
  • NBiot module
  • Industrial Ethernet Switch
  • 5G router gateway
  • Minipcie serial card
  • Serial Server
  • Serial wifi module
  • ICP license: ZXTC Technology Co., LTD. ICP:粤ICP备14025924号-2