Você está na página 1de 56

2011 Automation Summit

Orlando, FL

Navigating the world of automation

Navigating the world of automation


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 2
DMC Company Profile

 Established in 1996, based in Chicago, IL


 Service Companies Nationally & Globally
 Siemens Solution Partner

Global Reach: Czech


Canada
Russia
Georgia
Mexico
China
India
Philippines
Rep.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 3
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.
Page 4
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?

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 5
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 6
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 7
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 8
Top Ten S7 Tips and Tricks

Tips and Tricks for:

3.Rapid Diagnostics / Troubleshooting

5.Rapid Development

7.Advanced Tools

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 9
Modular, Object-Oriented
Architecture with FBs and UDTs

#1

Navigating the world of automation


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

System Architecture

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Modular, Object-Oriented Architecture with FBs
and UDTs

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:

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
Outputs Inputs

Start Start
Stop Stop

Motor Command Speed SP Speed SP Motor I/O


Function Block Engage Brake Engage Brake Function Block

Reset Error Reset Error


Acceleration Acceleration

Motor I/O
Motor Command Command Command Function
Function Block
Block

Start
Stop
Speed SP One variable is used
Engage Brake
Reset Error to pass multiple
Acceleration piecesCopyright
of information Navigating the world of automation
© Siemens Industry, Inc. 2011. All rights reserved.
Page 19
Monitoring Instances of Function
Blocks

#2

Navigating the world of automation


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.

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.
Page 21
Monitoring Instances of Function Blocks

This option is also shown in the Debug -> Operation dropdown menu from the
Ladder Editor

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 22
Monitoring Instances of Function Blocks

Right-click on the block and select “Monitor with Call-Up Path”

Process Mode Test Mode

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 23
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.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 24
Report System Error

#3

Navigating the world of automation


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 displaye

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 26
Report System Error

End Result:

No (0) programming required!

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 27
Report System Error

10 easy steps: (website has screenshots and full instructions)

 Create S7 and HMI stations.


 Add languages. Set “English” as default
 Open the "Report System Error..." dialog in hardware configuration.
 Activate the entries. Choose the OB blocks that will generate messages
 Transfer blocks to the CPU. Download the generated blocks to the CPU.
 Add a connection to the CPU from the WinCC flexible project (if needed)
 Configure alarm settings. Activate Simatic SFM in the alarm procedure.
 Configure alarm viewer to include “S7 Alarms”
 Activate the check boxes in CPU Messages from Simatic Manager
 Start WinCC flexible and enjoy your diagnostic messages!

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 28
RAM Disk

#4

Navigating the world of automation


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 3rd party software.
• RAM Disk is orders of magnitude faster than other forms of storage media.
• We’ve reduced >10 min compile times to <3 min.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 30
Auto-Generate Symbol Table

#5

Navigating the world of automation


Auto-Generate Symbol Table

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.
Page 32
Auto-Generate Symbol Table

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 33
Using Local Memory to Parse
Data

#6

Navigating the world of automation


Using Local Memory to Parse Data

Split data types into smaller pieces without using ST or SCL.

3. Assign a variable to TEMP memory.

10. Move data into the TEMP memory variable.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 35
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.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 36
Network Node Activating,
Deactivating, and Monitoring

#7

Navigating the world of automation


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

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 38
Network Node Activating, Deactivating, and
Monitoring

Monitoring Ethernet Nodes using “RDSYSST” SFC51

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 39
Safety Programming

#8

Navigating the world of automation


Safety Programming

• Leverage Siemens safety blocks

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 41
Safety Programming

• Safety program can be really simple or really complicated depending on the


application.

• Example of implementing simple E-Stop safety functionality:

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 42
Safety Programming

• Always ON and OFF variables available inside “F_GLOBDB” datablock.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 43
Backup DB Data by Generating
Source

#9

Navigating the world of automation


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.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 45
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.

5.Go online with all of the blocks in Simatic Manager.


6.Copy the online version of the data block whose values you would like to retain
into your offline project.
7.Add the items to end of the data block.
8.Download - your values will be retained.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 46
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.

3.Follow steps 1 and 2 above.


4.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.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 47
Backup DB Data by Generating Source

10. Make all changes that you need to the data block (not source code)
then Save and Close the data block.
11. 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.
12. Download - your values have been retained.

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 48
Keyboard Shortcuts

#10

Navigating the world of automation


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)

Jump to Network: Ctrl-E

Reference Data Interface: Ctrl-R

Open an FC or FB: Ctrl-Alt-O

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 50
Keyboard Shortcuts

Development Shortcuts

New Empty Rung / Network: Ctrl-R

Normally open contact: F2


Normally closed contact: F3
Coil: F7

Empty Box: Alt-F9

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 51
Keyboard Shortcuts

Monitoring / Diagnostics / Other Shortcuts

Monitor: Ctrl-F7

Module Information: Ctrl-D

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 52
Keyboard Shortcuts

Monitoring / Diagnostics / Other Shortcuts

Operating Mode: Ctrl-I

Download: Ctrl-L

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 53
Summary

Navigating the world of automation


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.
Page 55
Thank You

Nick Shea
nick.shea@dmcinfo.com

www.dmcinfo.com

Navigating the world of automation


Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Page 56

Você também pode gostar