top ten programming mistakes by people new to siemens

80
Navigating the world of automation 2011 Automation Summit Orlando, FL Navigating the world of automation

Upload: dmc-inc

Post on 15-May-2015

13.728 views

Category:

Technology


21 download

DESCRIPTION

DMC, a Siemens Solution Partner with the most S7 Certified Engineers in the United States, presented insights to people new to Siemens to help avoid common mistakes at the 2011 Siemens Automation Summit. Over the years we have encountered numerous applications written by novices and seen first-hand some of the more common errors made.

TRANSCRIPT

Page 1: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation

2011 Automation Summit Orlando, FL

Navigating the world of automation

Page 2: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 2

2011 Automation Summit

Title: Top Ten Programming Mistakes Made by People New to S7

Track:#56

Topic: Learn about some of the common problems experienced by people learning S7.

Presenter: Tim Jager

Company: DMC

Top Ten Programming Mistakes Made by People New to S7

Page 3: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top Ten Programming Mistakes Made by People New to S7

Page 3

Page 4: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

30 Employees

Company Profile

Since 1996

Based In Chicago…

…but work Globally

DMC has the highest number of S7 certified engineers

Page 5: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Our customers

Page 6: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Manufacturing and Automation IntelligenceMicrosoft SharePoint Consulting ServicesTest and MeasurementCustom Software Engineering & Embedded Systems

Areas of Expertise

Page 7: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Dulles Airport Transit Tunnel Ventilation System WinCC Redundancy S7 400H Redundant PLC 4000 I/O Points

Relevant Siemens Projects

Page 8: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Batch Mixing Systems for Confectionary Company

S7-300 Standardized code base Deployment at multiple facilities Mixing/batching control Recipe management Web-based reporting system

Relevant Siemens Projects

Page 9: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Automotive Assembly Lines for Tier 1 Supplier

S7 400 PLC’s WinCC Flex HMI’s Standardized code base User Configurable JIT - Lean Manufacturing Deployment at multiple facilities

Relevant Siemens Projects

Page 10: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

US Navy LCS-1

Littoral Combat Ship S7 400H Redundant PLC

Mission Critical Logic

Relevant Siemens Projects

Page 11: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Presenter Info

Tim Jager

Project Director at DMC

Mechanical Engineer (University of Illinois)

Licensed Professional Engineer in Illinois

With DMC since 1999

Page 12: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#1Page 12

Simple Hardware mistakes

Page 13: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 13

My PLC Doesn’t Work???

Page 14: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 14

It needs a memory card

My PLC Doesn’t Work???

Page 15: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 15

It needs a memory card

It’s in STOP Mode

My PLC Doesn’t Work???

Page 16: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 16

I wonder what’s on the MMC Card?

Page 17: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 17

I wonder what’s on the MMC Card?

Page 18: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 18

I wonder what’s on the MMC Card?

Page 19: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 19

Page 20: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Common Hardware Mistakes

Page 20

This is not an RS232 Serial Port!!!

Page 21: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#2Page 21

Using Absolute Address Priority instead of Symbolic

Page 22: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Set your Address Priority to Symbolic

You Just took the Red pill…. You are on your way down the rabbit hole that leads down the path of true object oriented PLC Programming.

Page 22

Page 23: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Typical Data Block

DB1 “dbGlobals”

Page 23

Page 24: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Typical Data Block

DB1 “dbGlobals”

Page 24

Address:

DB1.DBX0.0

Symbol Name:

“dbGlobals”.bStart

Page 25: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Typical Rung Of Ladder

Page 25

Page 26: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Typical Rung Of Ladder

Page 26

Address Logic

Symbolic Logic

Page 27: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Typical Rung Of Ladder

Page 27

Address Logic

Symbolic Logic

Page 28: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

What happens if we change the Data Block?

Page 28

Page 29: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Absolute vs. Symbolic Priority

Page 29

In Symbolic Mode the intended logic is maintained

The address logic has changed from 0.1 to 0.2

The symbolic logic is maintained

Page 30: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Absolute vs. Symbolic Priority

Page 30

But the Symbolic logic is totally wrong!

The Address logic is maintained

In Absolute Mode the intended logic is NOT maintained!

Page 31: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Absolute vs. Symbolic Priority

Page 31

Absolute Address

2222N. Elston Ave

Chicago, IL 60614

Symbolic Address

[email protected]

VS.

You don’t have to know where the server lives or it’s IP address. You just need the symbolic name to send an email.

So start forgetting about addresses and start thinking about symbolic names.

Page 32: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#3Page 32

I/O Mapping

Page 33: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

…I'M GONNA PROGRAM… LIKE IT'S 1999

Page 33

Input / Output Mapping

Page 34: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Traditional Input / Output Mapping

Page 34

1. At the beginning of the scan, Each physical input gets mapped to an internal variable…

Physical Input

Internal Variable

Page 35: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Traditional Input / Output Mapping

Page 35

1. At the beginning of the scan, Each physical input gets mapped to an internal variable…

2. Now run all of the logic (which references only internal bits)…

Internal Variable

Internal Variable

Page 36: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Traditional Input / Output Mapping

Page 36

1. At the beginning of the scan, Each physical input gets mapped to an internal variable…

2. Now run all of the logic (which references only internal bits)…

3. …At the end of the scan, internal “output” bits get mapped to physical outputs

Internal Variable

Physical Output

Page 37: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 37

S7 I/O Mapping – Just use the Symbol Table

Make sure you are in Symbolic Priority Mode

Page 38: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#4Page 38

Improper Use of Bit Memory

AKA: Mbits

Page 39: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 39

M0.0M0.1M0.2M0.3M0.4M0.5M0.6M0.7M1.0M1.1M1.2M1.3M1.4M1.5M1.6M1.7M2.0M2.1M2.2M2.3M2.4M2.5M2.6M2.7M3.0M3.1M3.2M3.3M3.4M3.5M3.6M3.7

M0.0 – M0.7

M1.0 – M1.7

M2.0 – M2.7

M2.0 – M2.7

MBits

Page 40: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 40

M0.0M0.1M0.2M0.3M0.4M0.5M0.6M0.7M1.0M1.1M1.2M1.3M1.4M1.5M1.6M1.7M2.0M2.1M2.2M2.3M2.4M2.5M2.6M2.7M3.0M3.1M3.2M3.3M3.4M3.5M3.6M3.7

MB0M0.0 – M0.7

M1.0 – M1.7

M2.0 – M2.7

M2.0 – M2.7

MB1

MB2

MB3

MBits MBytes

Page 41: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 41

M0.0M0.1M0.2M0.3M0.4M0.5M0.6M0.7M1.0M1.1M1.2M1.3M1.4M1.5M1.6M1.7M2.0M2.1M2.2M2.3M2.4M2.5M2.6M2.7M3.0M3.1M3.2M3.3M3.4M3.5M3.6M3.7

MB0M0.0 – M0.7

M1.0 – M1.7

M2.0 – M2.7

M2.0 – M2.7

MB1

MB2

MB3

MBits MBytes

MW0

MWords

MW1

Page 42: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 42

M0.0M0.1M0.2M0.3M0.4M0.5M0.6M0.7M1.0M1.1M1.2M1.3M1.4M1.5M1.6M1.7M2.0M2.1M2.2M2.3M2.4M2.5M2.6M2.7M3.0M3.1M3.2M3.3M3.4M3.5M3.6M3.7

MB0M0.0 – M0.7

M1.0 – M1.7

M2.0 – M2.7

M2.0 – M2.7

MB1

MB2

MB3

MBits MBytes

MW0

MWords

MW1

MD0

MDoubleWords

Page 43: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

• Debugging• Quick prototyping / demonstrations• When you absolutely have to!

Page 43

Page 44: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

Page 44

M-Bits

• Critical / Time-sensitive field fixes*

* As long as you promise to put in a permanent fix when the heat is off.

Page 45: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

Page 45

If you use MBits, make sure they are NOT IN USE already.

Page 46: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

..and make sure to add symbol names in the symbol table.

Page 46

Page 47: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

Or suffer the consequences……

Page 47

Page 48: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

When is it OK to use M Bits?

•Clock Byte

Page 48

Page 49: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#5Page 49

Not using or Improperly using the Clock Byte

Page 50: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

What is the Clock Byte?

Page 50

Bit of the Clock Memory Byte 7 6 5 4 3 2 1 0Period Duration (s) 2.0 1.6 1.0 0.8 0.5 0.4 0.2 0.1Frequency (Hz) 0.5 0.625 1 1.25 2 2.5 5 10

Each bit of the clock memory byte is assigned a frequency.

Page 51: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Symbol Table Entry For Clock Byte

Page 51

Reserve these so nobody uses Memory overlapping the Clock Byte

Page 52: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte

Page 52

The bits within the Clock byte can change at any time during the scan.

Page 53: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte – Synchronous Global

Page 53

UDT1 “udtClockByte”

Page 54: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte – Synchronous Global

Page 54

DB1 “dbGlobals”

Page 55: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte – Synchronous Global

Page 55

DB1 “dbGlobals”

Page 56: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte – Synchronous Global

Page 56

DB1 “dbGlobals”

Page 57: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Clock Byte – Synchronous Global

Page 57

MB0 dbGlobals.ClockByte

Page 58: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 58

M0.0

M0.1

M0.2

M0.3

M0.4

M0.5

M0.6

M0.7

“Always_False”

Mapped to M0.0

“Always_True”

Mapped to M0.1

What Happens If……

Page 59: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Page 59

M0.0

M0.1

M0.2

M0.3

M0.4

M0.5

M0.6

M0.7

Clock Byte

Mapped to MB0

“Always_False”

Mapped to M0.0

“Always_True”

Mapped to M0.1

What Happens If……

Page 60: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Overlapping Mbits are BAD!

Page 60

Page 61: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#6Page 61

Using Uninitialized Temp Memory

Page 62: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

What is Temp Memory?

Page 62

Page 63: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Improper Use of Temp Memory

Page 63

Page 64: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Improper Use of Temp Memory

Page 64

Don’t read from a TEMP unless you have written to it first!

Page 65: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#7Page 65

Not Using Timed Interrupts.

Page 66: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

OB1 vs. OB30..38

Page 66

OB1

Runs as fast as it can.

OB30…OB38

Run at specific time intervals.

Page 67: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Timed Interrupts OB30..OB38

Page 67

PID Control Data Sampling

Page 68: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#8Page 68

Not using reusable function blocks

Page 69: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

A Function Block is a piece of reusable code that consists of:

Code is encapsulated in a Highly reusable form

Increases Programming efficiency and reduces errors

What is a Function Block

Page 70: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

One of the simplest and most commonly used function block is a

Timer.

TON

IN

T#200ms PT ET 178

Q

Timer

Page 71: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Creation of Function Block

Isolate Common/Duplicate Code

If the same code is used many times in your program, consider creating function blocks.

Page 72: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Step 1. locate common code.

Creation of Function Block

Isolate Common/Duplicate Code

Page 73: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Step 1. locate common code.

Creation of Function Block

Isolate Common/Duplicate Code

Page 74: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Step 2. Replace duplicated code with function blocks.

Creation of Function Block

Isolate Common/Duplicate Code

Page 75: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Custom FB ExamplesMotor

FB

Pump

FB

Cylinder

FB

Barcode Scanner

FB

Label Printer

FB

Valve

FB

Machine Vision

FB

Robot Interface

FB

Page 76: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#9Page 76

Inconsistent Blocks

Page 77: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Check Block Consistency

Page 77

Don’t forget to download the Data Block!!

Page 78: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

Page 78

And last but not least……..

Page 79: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Top 10 S7 Mistakes

#10Page 79

Going it Alone

Page 80: Top Ten Programming Mistakes by People New to Siemens

Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.

Thank You!

Page 80