PROFINET IRT: Getting Started with the Siemens CPU 315

PROFINET IRT: Getting Started with The
Siemens CPU 315 PLC
AN-674
Application Note
This document shows how to demonstrate a working design using the PROFINET
isochronous real-time (IRT) device firmware. Associated equipment includes the
Altera® DE2-115 Evaluation Board and the Siemens CPU 315 Programmable Logic
Controller (PLC). You can use this design as the starting point for any custom design
that can make use of Altera FPGAs and the Softing PROFINET IRT.
f The steps in this document assume that the Altera DE2-115 board has been updated
with the IP provided by Softing. Consult the Softing documentation for the
appropriate steps to build, download, and optionally debug the firmware. For more
information, refer to the Design for Multiple Industrial Ethernet Protocols page.
Required Equipment and Components
Review the following list of equipment and components:
■
Siemens SIMATIC Step7 version 5.5 SP2.
This version installs and runs on Microsoft Windows 7 (64-bit) and as WinXP
running under Virtual PC on 64-bit Windows 7.
Siemens SIMATIC Step7 version 5.5 without SP2 installs and runs on Windows XP,
but does not install on a 64-bit operating system. Altera strongly recommends
Step7 version 5.5 including SP2.
If you see the following message (Figure 1) when attempting to install SIMATIC
Step7, please update the version of Step7 to SP2 or install on Windows XP 32-bit.
Windows XP on Virtual PC also works.
Figure 1. Setup Warning for Incompatible Version
■
Siemens PLC, CPU 315-2 PN/DP.
Other Siemens S7-300 PLC models could work with this design, but for assured
results, Altera recommends the CPU 315-2 PN/DP.
101 Innovation Drive
San Jose, CA 95134
www.altera.com
April 2013
© 2013 Altera Corporation. All rights reserved. ALTERA, ARRIA, CYCLONE, HARDCOPY, MAX, MEGACORE, NIOS,
QUARTUS and STRATIX words and logos are trademarks of Altera Corporation and registered in the U.S. Patent and Trademark
Office and in other countries. All other words and logos identified as trademarks or service marks are the property of their
respective holders as described at www.altera.com/common/legal.html. Altera warrants performance of its semiconductor
products to current specifications in accordance with Altera's standard warranty, but reserves the right to make changes to any
products and services at any time without notice. Altera assumes no responsibility or liability arising out of the application or use
of any information, product, or service described herein except as expressly agreed to in writing by Altera. Altera customers are
advised to obtain the latest version of device specifications before relying on any published information and before placing orders
for products or services.
ISO
9001:2008
Registered
Altera Corporation
Feedback Subscribe
Page 2
Connect Devices
■
Siemens SIMATIC S7-300 memory card.
■
Siemens Power Supply PS307 24 V/2A.
You can also use an industrial 24-V, 1-A power supply.
■
Altera DE2-115 Evaluation Board, or equivalent (Real-Time Ethernet Module
(RTEM) from Softing).
The instructions in this application note use the Altera DE2-115.
■
CAT5 Ethernet Cables.
■
Optional: Ethernet switch (managed or unmanaged).
However, a managed switch with port mirroring capabilities is useful for
debugging.
■
Optional: Siemens USB PC adapter.
All configuration can be done through the SIMATIC Step7 software through an
Ethernet connection.
A list of Siemens part descriptions and inventory part number are provided in Table 1.
.
Table 1. Siemens Part Numbers
Siemens Part Description
Siemens Part Number
Siemens Step7 v5.5 SP2
SC 6ES78104CC100YA5
Siemens S7-300 Micro Memory Card
SC 6ES79538LJ300AA0
Siemens CPU 315-2 PN/DP, 384
SC 6ES73152EH140AB0
Siemens Power Supply PS307 24 V/2A
SC 6ES73071BA010AA0
SIMATIC S7-300 Rail
SC 6ES73901AE800AA0
Connect Devices
To connect the devices, perform these steps:
1. Connect the CPU 315-2 PN/DP to the power supply.
2. Connect the CPU 315 to the personal computer running Step7 through an Ethernet
connection to one of the two Ethernet connectors, either directly or through a
common Ethernet switch.
3. Connect power to the Altera DE2-115 board.
4. Connect Ethernet from the remaining Ethernet port on the CPU 315 to the Altera
DE2-115 board.
1
The PROFINET-IRT design has a built-in time limitation that allows for a two-hour
evaluation period. Contact your local FAE for a security development kit to extend the
evaluation time period.
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 3
Installation and Setup
The installation and setup requires that you install Siemens Step7 v5.5 SP2 and
initially accept all the defaults.
If you need to install a license, follow the installation instructions for getting the
license installed.
After installation, perform the steps in next section. These steps assume that the
software is running for the first time, so not all steps may be necessary.
Using the SIMATIC Manager
To open the SIMITAC Manager, perform the following:
1. From the Start button, click Siemens Automation > SIMATIC > SIMATIC
Manager.
When running for the first time, a dialog box may appear titled STEP 7 Wizard:
“New Project.” Click Cancel and continue with the following step 2.
2. From the SIMATIC Manager, click Help > About and verify the version is v5.5 +
SP2.
3. Ensure the Active network interface is selected and that the PLC and INK board are
connected using the Active TCP/IP network interface.
4. Ensure that the CAT5 network cable is connected directly between the PC or
laptop and the PLC or INK board.
5. Ensure that the PLC and INK boards are connected through a CAT5 cable. It does
not matter if the PC or laptop network interface TCP/IP address is set to the same
TCP/IP subnet address or not.
6. Set the interface to the PLC and INK from the SIMATIC Manager: Options > Set
PG/PC Interface. The Set PG/PC Interface dialog box (Figure 2 on page 4)
appears.
7. Select the Intel 82579LM Gigabit Network Connection.TCPIP.1 <Active>
interface parameter for the attached device under test (DUT) and click OK.
April 2013
Altera Corporation
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 4
Installation and Setup
Figure 2 shows the Intel 82579LM Gigabit Network Connection.TCPIP.1
<Active> interface parameter assignment for configuring the PLC and INK.
Figure 2. Set PG/PC Interface
Creating a New Project
To create a new project, perform these steps:
1. From the SIMATIC Manager, click File > New Project Wizard. The STEP 7
Wizard: “New Project” dialog box appears, and click Next.
2. Select the PLC CPU type: CPU315-2 PN/DP as shown in Figure 3, and click Next.
Figure 3. Choosing the CPU Type
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 5
3. Ensure that the OB1 (Cycle Execution) Block is checked and the Language STL
option is selected, and click Next.
4. Edit the project name, or use the default name, and click Finish.
After clicking Finish, the output should look like Figure 4. If the screen looks
different, try clicking on Blocks in the left panel to display the OB1 block in the
right panel.
Figure 4. SIMATIC Manager with OB1 Block (Detail)
5. Click SIMATIC 300 Station in the left panel to reveal Hardware and
CPU315-2 PN/DP(1) blocks in the right panel (Figure 5).
Figure 5. SIMATIC Manager with Hardware and CPU Blocks (Detail)
6. Double-click Hardware and a separate HW Config - SIMATIC 300 Station window
should appear.
April 2013
Altera Corporation
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 6
Installation and Setup
7. Right-click CPU315-2 PN/DP(1) and select Object Properties on the menu
(Figure 6).
Figure 6. HW Config - SIMATIC 300 Station Window
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 7
8. In the Properties dialog box (Figure 7), change the Name property from CPU315-2
PN/DP(1) to pn-io, and click OK.
Figure 7. Properties Dialog Box
Inserting a New PROFINET I/0 Network from the CPU Object
9. Left-click PN-IO in the top section of the Station Configuration window next to
X2. This is not the same as the name you edited in the previous step.
10. Right-click Insert PROFINET IO System and the Properties - Ethernet Interface
dialog appears.
11. Set the values for the IP Address and Subnet mask boxes to suitable addresses for
your configuration. If you need a suggested address, try
172.20.40.1/255.255.0.0.
12. Select the Do not use router radio button.
13. Click the New button next to the Subnet box and the Properties - New Subnet
dialog box appears.
14. In the Name box, under the General tab, type IRT, and click OK.
Installing the GSD File for the Example Device
15. In the HW Config - SIMATIC 300 Station window, on the Options menu, click
Install GSD File and the Install GSD Files dialog box appears.
16. In the Install GSD Files dialog box, click Browse and point to the directory where
the GSDML-V2.*.xml is located. The directory is under
altera_ink_switch\software\devicedescription\profinet.
April 2013
Altera Corporation
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 8
Installation and Setup
17. Select GSDML-V2.3-Softing-Altera-INK-20120522.xml and click Install
(Figure 8).
Figure 8. Install GSD Files Dialog Box
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 9
Adding the Softing I/O Device to the PROFINET IO Network
18. In the right panel of the HW Config - SIMATIC 300 Station window, under
PROFINET IO, select PROFINET IO Reference Device for Altera INK (Figure 9)
and drag it to connect to the IRT: PROFINET-IO-System network in the left panel
as shown in Figure 10.
Figure 9. Right Panel on the SIMATIC 300 Station
Figure 10. Left Panel on the SIMATIC 300 Station
When connected properly, you can see a picture of the INK as shown in Figure 10.
19. Right-click the INK picture, and select Object Properties. The Properties dialog
box appears.
a. In the Device name box, type the name irt-ink.
b. Change the Device number to 3.
c. Click the Ethernet button and set the IP address to 172.20.40.4, and verify the
Subnet mask is 255.255.0.0.
April 2013
Altera Corporation
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 10
Installation and Setup
20. In the bottom panel of the HW Config - SIMATIC 300 Station window, right-click
the X1 slot, select Object Properties, and the Properties dialog box appears.
a. On the General tab, and change the Name to irt-ink.
b. On the IO Cycle tab, change Mode to Fixed update time and Update Time
[ms] to 16.000. Click OK.
Setting the I/O Addresses on the INK
21. In the bottom panel of the SIMATIC 300 Station window, change the I/O
addresses as shown in Table 2 and Figure 11.
Table 2. I/O Addresses on the INK
Slot
Module
Order number
I address
Q address
1
Digital 8 Bit Input
DI-MODULE-8BIT
0
—
2
Digital 8 Bit Output
DO-MODULE-8BIT
—
2
3
Digital 16 Bit Input
DI-MODULE-16BIT
5...6
—
4
Digital 16 Bit Output
D0-MODULE-16BIT
—
5...6
Figure 11. I/O Addresses on the INK (Detail)
22. Before switching back to the SIMATIC Manager window, select Save and Compile
from the Station menu.
Check Connectivity
23. To check connectivity and configuration before adding the PLC program, switch to
the SIMATIC Manager window.
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 11
24. On the PLC menu, click Edit Ethernet Node. In the Edit Ethernet Node dialog
box, click Browse, and the Browse Network dialog box appears showing the
devices (Figure 12).
1
You should see at least the PLC and INK devices with the configured IP
address, MAC address, and gateway. If these devices do not appear, check
the previous steps and the network connectivity. There may be a
connectivity problem between the PC and the devices.
Figure 12. Browse Network Nodes
April 2013
Altera Corporation
1
If the subnet mask addresses show up as dashes, simply clicking on the IP
addresses row (Figure 12) should make the subnet addresses appear.
1
If the devices do not appear in the Browse Network dialog box, there is a
connectivity problem between the PC and the devices. Try configuring one
device at a time instead of both devices simultaneously. Check all cables,
make sure they are plugged in and power is applied.
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 12
Installation and Setup
25. In the Browser Network dialog box, select a device in the Edit Ethernet Node
dialog box and click OK. You will need to perform the following steps for both
devices:
a. Enter the values for IP address (172.20.4.4) and Subnet mask (255.255.0.0)
as shown in Figure 13.
b. Click Assign IP Configuration. The software then contacts the selected device
and configures it based on the IP values you typed in the previous step.
c. Type in a name for the Device name box, and click Assign Name.
Figure 13. Edit Ethernet Node Dialog Box
Setting Up the Sample PLC Program
26. From the SIMATIC Manager program window, click File > Open > Browse.
27. Navigate to the directory that contains the sample project:
<ProjectRoot>\Altera_141112\altera_ink_switch\altera_ink_switch\software\p
lc\profinet\Siemens\Step7\CPU-315_INK_1ms_STEP7\CPU-315_INK_1ms,
where <ProjectRoot> is a location such as C:\INKProject.
28. Open the sample PLC project file CPU-315_INK_1ms.
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation
Installation and Setup
Page 13
29. In the sample PLC project, click on Bausteine as shown in the bottom window of
Figure 14.
1
Bausteine is German for bricks, modules, or blocks, same as Blocks in the
English language project in the top window.
Figure 14. Sample PLC Project (Detail)
30. Copy only OB1, OB82, and OB86 objects from the sample project to the newly
created project.
1
Do not copy the Systemdaten object from the sample project to the new
project. This object is a symbol file in German. If you copied it in your
English project, it could corrupt your project and cause you to recreate the
project from the beginning.
Download the PLC Configuration, Program, and Run
31. Switch back to the HW Config - SIMATIC 300 Station window.
32. Click PLC > Download > pn-io > OK. Allow the newly created configuration and
program to download and run. At this point, the PLC and INK should be
configured and ready to run.
33. Flip the switch on the PLC from stop mode to run mode and allow the program to
run. It may take several minutes for the PLC to configure and start running the
program on the INK as expected. If the PLC program is not running within five
minutes, go back and check all the steps.
April 2013
Altera Corporation
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
Page 14
Document Revision History
After this last step has been completed, you do not need to use the Siemens SIMATIC
software since the PLC has been programmed. However, if any of the I/O addresses
have changed, then the PLC may need to be reprogrammed.
Document Revision History
Table 3 lists the revision history for this document.
Table 3. Document Revision History
Date
April 2013
Version
1.0
Changes
Initial release.
PROFINET IRT: Getting Started with The Siemens CPU 315 PLC
April 2013
Altera Corporation