You are on page 1of 56

Navigating the world of automation

2011 Automation Summit


Orlando, FL
Navigating the world of automation
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 2
2011 Automation Summit
Title: Top Ten S7 Tips and Tricks
Track: NAPR
Topic: S7 PLCs
Presenter: Nick Shea
Company: DMC
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 3
DMC Company Profile
Established in 1996, based in Chicago, IL
Service Companies Nationally & Globally
Siemens Solution Partner
Global Reach:
Canada China Georgia Czech Rep. Russia Philippines Mexico India
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 4
Bio
Nick Shea
Senior Project Engineer at DMC
Engineering Physics
(University of Kansas)
With DMC since 2006
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Top Ten S7 Tips and Tricks
You already know the fundamentals of S7 PLC
programming
And the mistakes to avoid (thanks, Tim)
Now, how do you develop, commission and
troubleshoot most efficiently?
Page 5
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 6
Top Ten S7 Tips and Tricks
If you are an
External Developer:
How do you work most efficiently to provide the highest
value for your customer while increasing project profitability?
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 7
Top Ten S7 Tips and Tricks
If you are an
Internal Programmer:
How do you reduce start-up time for new equipment and
decrease production downtime while making modifications
or troubleshooting controls problems?
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 8
Top Ten S7 Tips and Tricks
Now take your development to the next Level!
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 9
Top Ten S7 Tips and Tricks
Tips and Tricks for:
1. Rapid Diagnostics / Troubleshooting
2. Rapid Development
3. Advanced Tools
Navigating the world of automation
Modular, Object-Oriented
Architecture with FBs and UDTs
#1
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Best Practices for Controls Design Generally Accepted
Consistent Design and Documentation
Mechanical Design
Electrical Schematics
P&IDs
Software
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Best Practices for Controls Design also includes:
PLC and HMI Projects
Naming conventions
Hardware architecture
Modular Software Architecture
Function Blocks
UDTs
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Line 1
Mixer 1
Agitator
VFD
Discharge
Valve
Mixer 2
Agitator
VFD
Discharge
Valve
Mixer 3
Agitator
VFD
Discharge
Valve
Ventilation
Damper
Blower
Motor
Conveying
Pump
Motor
Distribution
Valve
System Architecture
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
fbMaster
fbMixer_1
fbVFD
fbValve
fbMixer_2
fbVFD
fbValve
fbMixer_3
fbVFD
fbValve
fbVentilation
fbDamper
fbMotor
fbConveying
fbMotor
fbValve
Program Architecture
(similar to system architecture!)
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Example of High-Level Function Block:
fbMixer_1
fbVFD fbValve
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Example of Device Level Function Block utilizing UDTs:
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Variables encapsulated by udtHMI_VFD_Control
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Variables encapsulated by udtErrors_VFD
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs
Page 19
Motor Command
Function Block
Start
Stop
Speed SP
Engage Brake
Reset Error
Acceleration
Motor I/O
Function Block
Start
Stop
Speed SP
Engage Brake
Reset Error
Acceleration
Outputs Inputs
One variable is used
to pass multiple
pieces of information
Start
Stop
Speed SP
Engage Brake
Reset Error
Acceleration
Motor Command
Function Block
Command
Motor I/O
Function
Block
Command
Navigating the world of automation
Monitoring Instances of Function
Blocks
#2
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Monitoring Instances of Function Blocks
There are two PLC modes and they are toggled in the CPU Properties on the
Protection tab: Process Mode and Test Mode.
Page 21
Default is Process mode.
Switch to Test Mode.
Download the hardware configuration.
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Monitoring Instances of Function Blocks
This option is also shown in the Debug -> Operation dropdown menu from the
Ladder Editor
Page 22
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Monitoring Instances of Function Blocks
Right-click on the block and select Monitor with Call-Up Path
Process Mode Test Mode
Page 23
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Monitoring Instances of Function Blocks
Note!
As you probably expect, this does slow down the CPU cycle time so this should
only be used when necessary and always leave the final system with Process
Mode checked.
Page 24
Navigating the world of automation
Report System Error
#3
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Report System Error
Siemens Support Website
FAQ: How can you report S7 system errors in WinCC?
FAQ: How can you have system error messages from a SIMATIC S7-300 / 400
displayed in WinCC flexible?
Page 26
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Report System Error
End Result:
No (0) programming required!
Page 27
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Report System Error
10 easy steps: (website has screenshots and full instructions)
1. Create S7 and HMI stations.
2. Add languages. Set English as default
3. Open the " Report System Error..." dialog in hardware configuration.
4. Activate the entries. Choose the OB blocks that will generate messages
5. Transfer blocks to the CPU. Download the generated blocks to the CPU.
6. Add a connection to the CPU from the WinCC flexible project (if needed)
7. Configure alarm settings. Activate Simatic SFM in the alarm procedure.
8. Configure alarm viewer to include S7 Alarms
9. Activate the check boxes in CPU Messages from Simatic Manager
10. Start WinCC flexible and enjoy your diagnostic messages!
Page 28
Navigating the world of automation
RAM Disk
#4
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
RAM Disk
When compiling an S7 project, many small files are read and written.
RAM Disk is RAM that is used as a disk drive via 3
rd
party software.
RAM Disk is orders of magnitude faster than other forms of storage media.
Weve reduced >10 min compile times to <3 min.
Page 30
Navigating the world of automation
Auto-Generate Symbol Table
#5
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Auto-Generate Symbol Table
Page 32
The S7 PLC symbol table allows copy/paste directly from a spreadsheet such as
MS Excel.
If possible, develop your IO list in a compatible format
Alternatively, build a tool to convert it to a compatible format
For example, thousands of IO can be added into the symbol list in a few
minutes.
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Auto-Generate Symbol Table
Page 33
Navigating the world of automation
Using Local Memory to Parse
Data
#6
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Using Local Memory to Parse Data
Split data types into smaller pieces without using ST or SCL.
1. Assign a variable to TEMP memory.
2. Move data into the TEMP memory variable.
Page 35
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Using Local Memory to Parse Data
Split data types into smaller pieces without using ST or SCL.
3. Access the TEMP or Local memory using the L prefix.
Page 36
Navigating the world of automation
Network Node Activating,
Deactivating, and Monitoring
#7
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Network Node Activating, Deactivating, and
Monitoring
Dynamically activate and Deactivate
Profibus and Profinet Nodes
Using D_ACT_DP SFC12
Examples:
Modular Machines
Alternate Machine Configurations
Page 38
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Network Node Activating, Deactivating, and
Monitoring
Monitoring Ethernet Nodes using RDSYSST SFC51
Page 39
Navigating the world of automation
Safety Programming
#8
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Safety Programming
Leverage Siemens safety blocks
Page 41
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Safety Programming
Safety program can be really simple or really complicated depending on the
application.
Example of implementing simple E-Stop safety functionality:
Page 42
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Safety Programming
Always ON and OFF variables available inside F_GLOBDB datablock.
Page 43
Navigating the world of automation
Backup DB Data by Generating
Source
#9
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Backup DB Data by Generating Source
A simple yet common problem when programming a Siemens Simatic S7-300
PLC is losing the data already stored in the PLC after downloading an updated
data block.
Page 45
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Backup DB Data by Generating Source
In the normal case:
If you are simply adding items to the end of a flat data block (not adding items to
a user-defined type (udt) within the data block, for example) then to retain the
values of the data block follow these quick steps.
1. Go online with all of the blocks in Simatic Manager.
2. Copy the online version of the data block whose values you would like to
retain into your offline project.
3. Add the items to end of the data block.
4. Download - your values will be retained.
Page 46
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Backup DB Data by Generating Source
A more complicated change to the data block such as adding items to a udt
used with the data block requires extra steps. Even if you have first saved a copy
of your online values prior to making the change, the values will be lost after you
save the change. Therefore, follow these extra steps.
1. Follow steps 1 and 2 above.
2. Open the datablock and Generate Source for the data block.
File -> Generate Source. This will save a version of your data block;
and the values in a file in the Sources folder.
Page 47
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Backup DB Data by Generating Source
3. Make all changes that you need to the data block (not source code)
then Save and Close the data block.
4. Open the Source file you created and compile it. This will set all values in the
data block equal to the values you see in the Source file.
5. Download - your values have been retained.
Page 48
Navigating the world of automation
Keyboard Shortcuts
#10
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Keyboard Shortcuts
Navigating / Searching
Cross Reference: Ctrl-Alt-Q
Find: Ctrl-F
Find Variables within a FC or FB: Ctrl-Shift-F (search forward)
or
Ctrl-Shift-B (search backward)
J ump to Network: Ctrl-E
Reference Data Interface: Ctrl-R
Open an FC or FB: Ctrl-Alt-O
Page 50
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Keyboard Shortcuts
Development Shortcuts
New Empty Rung / Network: Ctrl-R
Normally open contact: F2
Normally closed contact: F3
Coil: F7
Empty Box: Alt-F9
Page 51
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Keyboard Shortcuts
Monitoring / Diagnostics / Other Shortcuts
Monitor: Ctrl-F7
Module Information: Ctrl-D
Page 52
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Keyboard Shortcuts
Monitoring / Diagnostics / Other Shortcuts
Operating Mode: Ctrl-I
Download: Ctrl-L
Page 53
Navigating the world of automation
Summary
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Page 55
Summary Top Ten S7 Tips and Tricks
1. Modular, Object-Oriented Architecture with FBs and UDTs
2. Monitoring Instances of Function Blocks
3. Report System Error
4. RAM Disk
5. Auto-Generate Symbol Table
6. Network Node Activating, Deactivating, and Monitoring
7. Safety Programming Basics
8. Using Local Memory to Parse Data
9. Backup DB Data by Generating Source
10. Keyboard Shortcuts
Navigating the world of automation
Copyright Siemens Industry, Inc. 2011. All rights reserved.
Thank You
Nick Shea
nick.shea@dmcinfo.com
www.dmcinfo.com
Page 56

You might also like