top ten programming mistakes by people new to siemens
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/1.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/2.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/3.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/4.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/5.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/6.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/7.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/8.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/9.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/10.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/11.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/12.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/13.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/14.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/15.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/16.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/17.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/18.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/19.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/20.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/21.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/22.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/23.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/24.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/25.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/26.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/27.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/28.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/29.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/30.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/31.jpg)
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
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/32.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/33.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/34.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/35.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/36.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/37.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/38.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/39.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/40.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/41.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/42.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/43.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/44.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/45.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/46.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/47.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/48.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/49.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/50.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/51.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/52.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/53.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/54.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/55.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/56.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/57.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/58.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/59.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/60.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/61.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/62.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/63.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/64.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/65.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/66.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/67.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/68.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/69.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/70.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/71.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/72.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/73.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/74.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/75.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/76.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/77.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/78.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/79.jpg)
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](https://reader033.vdocuments.us/reader033/viewer/2022061505/55557dfab4c9058a5a8b5221/html5/thumbnails/80.jpg)
Navigating the world of automation Copyright © Siemens Industry, Inc. 2011. All rights reserved.
Thank You!
Page 80