Setting up S7-1200/1500¶
Requirements
- Siemens Edition or Ultimate Edition
- S7-1200/1500 PLC
- TIA Portal
Sample Project
This tutorial gives you step-by-step instructions on how to use a Siemens S7-1200/1500 PLC to control Factory I/O. Although the following instructions refer to an S7-1200 model, the same steps apply to the 1500.
Setting up communication between PC and PLC¶
-
Connect the PLC to the network.
-
Create a new project in TIA Portal.
-
Select Configure a device.
-
Click on Add new device. From the controllers' tree expand SIMATIC S7-1200 > CPU > Unspecified CPU 1200, select the CPU under it and click on Add.
-
You are now on TIA Portal's Project View. Click on detect to automatically detect the PLC from a list of available devices on the network.
-
Choose PN/IE as the type of PG/PC interface and on PG/PC interface select the network adapter that you are using to connect to the PLC.
-
When scanning completes, select the PLC from the list of compatible devices. Next, click on Detect.
If you are adding a PLC that is not in the same subnet as your computer, you will be prompted about assigning a new IP address to the network interface; click on Yes.
Later you may have to change the PLC's IP address to one in the same subnet as your computer, otherwise, Factory I/O might not be able to connect to it.
-
The detected PLC is now on the Device view. Some of its properties need to be tweaked to allow communication with Factory I/O. Double Left-click on the controller to open the Properties panel.
-
Start by assigning the PLC an IP address. On the General tab of the Properties page expand PROFINET interface and select Ethernet addresses.
If you were prompted about assigning a new IP address to the network interface, you should now assign an IP address to the PLC that is in the same subnet as your computer.
-
PLC physical inputs use by default the first memory addresses of %I. For Factory I/O to be able to write sensors values to %I you must offset the input addresses, we recommend an offset of 10. Click on I/O addresses and change the Input addresses > Start address to 10.
Factory I/O should not use input addresses that are assigned to physical inputs
Otherwise, the values written by Factory I/O will be overwritten as the state of physical inputs is copied to I memory.
-
Finally, some Protection & Security settings are required to be able to establish a connection to the PLC.
Click on Protection and enable Permit access with PUT/GET communication from remote partner under Connection mechanisms.
Set the Access level as HMI access or higher (Read access or Full access).
For PLCs with firmware lower than V4.0, the correct protection settings are:
-
Right-click on the device and select Download to device > Hardware configuration. Next, Start the CPU.
Connecting Factory I/O to the PLC¶
-
In Factory I/O click on FILE > Driver Configuration to open the Driver Window.
-
Select Siemens S7-1200/1500 on the driver drop-down list.
-
Open the driver Configuration Panel by clicking on CONFIGURATION.
-
Make sure S7-1200 is selected on the Model drop-down list and insert the PLC's IP address into the Host field.
-
Press Esc to return to the main driver window. Now click on CONNECT to connect to the PLC. A successful connection is indicated by a green icon next to the selected driver, as well as next to the driver's name displayed on the status bar.