Blog post by Shahrokh Yousefi, Controls Engineer, Patti Engineering Texas Office
While working on a machine that is controlled by a SIMATIC S7-200 controller, have you been surprised by the amount of control functions that this tiny PLC can handle? You might be even more surprised to know that you can establish a communication between this controller and other controllers on the production floor based on Ethernet technology. Connecting these controllers via Ethernet facilitates a flexible and distributed automation structure.
What you’ll need…
Since the S7-200 CPU module does not have the needed hardware for Ethernet communication, you need an extra hardware module which is Industrial Ethernet Communication Processor (CP 243-1) for data traffic handling and communication based on TCP/IP. This module provides Ethernet access via an RJ45 port.
Note: For connecting to the S7-200 PLC with your programming device through USB port, a special cable is needed to adapt USB to PPI protocol and “PC Adaptor (PPI)” should be selected in “Set PG/PC Interface”.
On the software side, the easiest way to connect a SIMATIC S7-200 PLC to another controller (SIMATIC S7-300/400 in this case) is using Ethernet Wizard in MicroWin software (Fig. 1). Keep in mind that for using Industrial Ethernet Wizard, MicroWin ver.4 or higher is needed. So, here are simple steps while you follow the wizard to accomplish the communication settings:
How to establish the connection…
Step 1: Specify position of the installed CP module regarding the CPU module in S7-200.
Step 2: Assign an IP Address for the CP 243-1 module (Fig. 2).
Step 3: Number of output bytes that are inserted before the CP module should be defined here. Besides that, number of concurrent connections (up to 8) is configured here.
Step 4: Defining S7-200 as a client or server. In this case, it is chosen as client for an S7-400 as server (Fig. 3). Next, Local Station vs. Remote Station should be defined;
TSAP (Free Connection): 10.00 when CP243-1 is located on the nearest slot to the S7-200 CPU
TSAP (Configured Mode): 10.00 when CP243-1 is located on the nearest slot to the S7-200 CPU (in Simatic Manager software and in Netpro, this value should be used in the defined connection between S7-400 station and the Unknown Station for S7-200)
TSAP (Free Connection): 0X03.02 because in this example the CP443-1 card is located on the slot no.4 in S7-400 plc.
TSAP (Configured Mode): 10.02 because in this example CP443-1 card is located on slot no.4 in S7-400 (in Simatic Manager for the S7-400 project, in Netpro a new connection should be defined to S7-200 as an Unknown Station)
IP Address of the remote station (S7-400 in this case)
Step 5: Read/Write operation is selected in “Data Transfer” step (Fig. 4). Also number of transferred bytes and address location of them are defined here. Each individual read/write message is named as a PeerMessageXX_X which will be used later in the code.
Eventually, two new sub-routines will be generated, named ETH0_CTRL and ETH0_XFR (Fig. 5)
The ETH0_CTRL sub-routine is used to enable and initialize the CP module. It should be called in each program cycle, and only be used once in the program.
The ETH0_XFR sub-routine is used to initiate a data transfer. It needs to be called separately for each transfer message which is defined in the “Data” pin.
That’s it! With these steps, your tiny-but-mighty SIMATIC S7-200 is connected via Ethernet to a SIMATIC S7-300/400.
If you’re looking to partner with expert engineers for control systems integration,