2011 Automation Summit Orlando, FLNavigating the world of automation<br />
Page 2<br />Top Ten Programming Mistakes Made by People New to S7<br />2011 Automation Summit<br />Title: Top Ten Programm...
Top Ten Programming Mistakes Made by People New to S7<br />Page 3<br />
Company Profile<br />Based In Chicago…<br />…but work Globally <br />DMC has the highest number of S7 certified engineers<...
Our customers<br />
Areas of Expertise<br />Manufacturing and Automation Intelligence<br />Test and Measurement<br />Custom Software Engineeri...
Relevant Siemens Projects<br />Dulles Airport Transit Tunnel Ventilation System<br /><ul><li>WinCC Redundancy
S7 400H Redundant PLC
4000 I/O Points</li></li></ul><li>Relevant Siemens Projects<br />Batch Mixing Systems for Confectionary Company<br /><ul><...
Standardized code base
Deployment at multiple facilities
Mixing/batching control
Recipe management
Web-based reporting system</li></li></ul><li>Relevant Siemens Projects<br />Automotive Assembly Lines for Tier 1 Supplier<...
WinCC Flex HMI’s
Standardized code base
User Configurable
JIT - Lean Manufacturing
Deployment at multiple facilities </li></li></ul><li>Relevant Siemens Projects<br />US Navy LCS-1 <br />Littoral Combat Sh...
Mission Critical Logic</li></li></ul><li>Presenter Info<br />Tim Jager<br />Project Director at DMC<br />Mechanical Engine...
Top 10 S7 Mistakes<br />#1<br />Page 12<br />Simple Hardware mistakes<br />
Common Hardware Mistakes<br />Page 13<br />My PLC Doesn’t Work???<br />
Common Hardware Mistakes<br />Page 14<br />My PLC Doesn’t Work???<br />It needs a memory card<br />
Common Hardware Mistakes<br />Page 15<br />My PLC Doesn’t Work???<br />It needs a memory card<br />It’s in STOP Mode<br />
Common Hardware Mistakes<br />Page 16<br />I wonder what’s on the MMC Card?<br />
Common Hardware Mistakes<br />Page 17<br />I wonder what’s on the MMC Card?<br />
Common Hardware Mistakes<br />Page 18<br />I wonder what’s on the MMC Card?<br />
Common Hardware Mistakes<br />Page 19<br />
Common Hardware Mistakes<br />Page 20<br />This is not an RS232 Serial Port!!!<br />
Top 10 S7 Mistakes<br />#2<br />Page 21<br />Using Absolute Address Priority instead of Symbolic<br />
Set your Address Priority to Symbolic<br />You Just took the Red pill…. You are on your way down the rabbit hole that lead...
A Typical Data Block<br />DB1 “dbGlobals”<br />Page 23<br />
A Typical Data Block<br />DB1 “dbGlobals”<br />Page 24<br />Symbol Name: <br />“dbGlobals”.bStart<br />Address: <br />DB1....
A Typical Rung Of Ladder<br />Page 25<br />
A Typical Rung Of Ladder<br />Page 26<br />Address Logic<br />Symbolic Logic<br />
A Typical Rung Of Ladder<br />Page 27<br />Address Logic<br />Symbolic Logic<br />
What happens if we change the Data Block?<br />Page 28<br />
Absolute vs. Symbolic Priority<br />Page 29<br />In Symbolic Mode the intended logic is maintained<br />The address logic ...
Absolute vs. Symbolic Priority<br />Page 30<br />In Absolute Mode the intended logic is NOT maintained!<br />The Address l...
Absolute vs. Symbolic Priority<br />Page 31<br />You don’t have to know where the server lives or it’s IP address. You jus...
Top 10 S7 Mistakes<br />#3<br />Page 32<br />I/O Mapping<br />
…I'm gonnaProgram… like it's 1999<br />Page 33<br />Input / Output Mapping<br />
Traditional Input / Output Mapping<br />Page 34<br />1. At the beginning of the scan, Each physical input gets mapped to a...
Traditional Input / Output Mapping<br />Page 35<br />1. At the beginning of the scan, Each physical input gets mapped to a...
Traditional Input / Output Mapping<br />Page 36<br />1. At the beginning of the scan, Each physical input gets mapped to a...
Page 37<br />S7 I/O Mapping – Just use the Symbol Table<br />Make sure you are in Symbolic Priority Mode<br />
Top 10 S7 Mistakes<br />#4<br />Page 38<br />Improper Use of Bit Memory<br />AKA: Mbits<br />
MBits<br />M0.0  – M0.7<br />M1.0  – M1.7<br />M2.0  – M2.7<br />M2.0  – M2.7<br />Page 39<br />
MBits<br />MBytes<br />M0.0  – M0.7<br />MB0<br />M1.0  – M1.7<br />MB1<br />M2.0  – M2.7<br />MB2<br />MB3<br />M2.0  – M...
MBits<br />MBytes<br />MWords<br />M0.0  – M0.7<br />MB0<br />MW0<br />M1.0  – M1.7<br />MB1<br />M2.0  – M2.7<br />MB2<br...
MBits<br />MBytes<br />MWords<br />MDoubleWords<br />M0.0  – M0.7<br />MB0<br />MW0<br />M1.0  – M1.7<br />MB1<br />MD0<br...
When is it OK to use M Bits?<br /><ul><li>Debugging
Quick prototyping / demonstrations
When you absolutely have to!</li></ul>Page 43<br />
When is it OK to use M Bits?<br />Page 44<br /><ul><li>Critical / Time-sensitive field fixes*</li></ul>M-Bits<br />* As lo...
When is it OK to use M Bits?<br />Page 45<br />If you use MBits, make sure they are NOT IN USE already.<br />
When is it OK to use M Bits?<br />..and make sure to add symbol names in the symbol table.<br />Page 46<br />
When is it OK to use M Bits?<br />Or suffer the consequences……<br />Page 47<br />
When is it OK to use M Bits?<br /><ul><li>Clock Byte</li></ul>Page 48<br />
Top 10 S7 Mistakes<br />#5<br />Page 49<br />Not using or Improperly using the Clock Byte<br />
What is the Clock Byte?<br />Page 50<br />Each bit of the clock memory byte is assigned a frequency.<br />
Symbol Table Entry For Clock Byte<br />Page 51<br />Reserve these so nobody uses Memory overlapping the Clock Byte<br />
Clock Byte<br />Page 52<br />The bits within the Clock byte can change at any time during the scan.<br />
Clock Byte – Synchronous Global<br />Page 53<br />UDT1 “udtClockByte”<br />
Clock Byte – Synchronous Global<br />Page 54<br />DB1 “dbGlobals”<br />
Clock Byte – Synchronous Global<br />Page 55<br />DB1 “dbGlobals”<br />
Clock Byte – Synchronous Global<br />Page 56<br />DB1 “dbGlobals”<br />
Clock Byte – Synchronous Global<br />Page 57<br />MB0<br />dbGlobals.ClockByte<br />
Page 58<br />What Happens If…… <br />“Always_False”<br />Mapped to M0.0<br />“Always_True”<br />Mapped to M0.1<br />
Page 59<br />What Happens If…… <br />“Always_False”<br />Mapped to M0.0<br />“Always_True”<br />Mapped to M0.1<br />Clock ...
Overlapping Mbits are BAD!<br />Page 60<br />
Top 10 S7 Mistakes<br />#6<br />Page 61<br />Using Uninitialized Temp Memory<br />
What is Temp Memory?<br />Page 62<br />
Improper Use of Temp Memory<br />Page 63<br />
Improper Use of Temp Memory<br />Page 64<br />Don’t read from a TEMP unless you have written to it first!<br />
Top 10 S7 Mistakes<br />#7<br />Page 65<br />Not Using Timed Interrupts.<br />
OB1 vs. OB30..38<br />Page 66<br />OB1 <br />Runs as fast as it can.<br />OB30…OB38 <br />Run at specific time intervals.<...
Timed Interrupts OB30..OB38<br />Page 67<br />PID Control<br />Data Sampling<br />
Top 10 S7 Mistakes<br />#8<br />Page 68<br />Not using reusable function blocks<br />
What is a Function Block <br /><ul><li>A Function Block is a piece of reusable code that consists of:
Upcoming SlideShare
Loading in...5
×

Top Ten Programming Mistakes by People New to Siemens

16,511

Published on

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.

Published in: Technology, Business
1 Comment
19 Likes
Statistics
Notes
No Downloads
Views
Total Views
16,511
On Slideshare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
848
Comments
1
Likes
19
Embeds 0
No embeds

No notes for slide

Top Ten Programming Mistakes by People New to Siemens

  1. 1. 2011 Automation Summit Orlando, FLNavigating the world of automation<br />
  2. 2. Page 2<br />Top Ten Programming Mistakes Made by People New to S7<br />2011 Automation Summit<br />Title: Top Ten Programming Mistakes Made by People New to S7<br />Track:#56<br />Topic: Learn about some of the common problems experienced by people learning S7. <br />Presenter: Tim Jager<br />Company: DMC<br />
  3. 3. Top Ten Programming Mistakes Made by People New to S7<br />Page 3<br />
  4. 4. Company Profile<br />Based In Chicago…<br />…but work Globally <br />DMC has the highest number of S7 certified engineers<br />Since 1996<br />30 Employees<br />
  5. 5. Our customers<br />
  6. 6. Areas of Expertise<br />Manufacturing and Automation Intelligence<br />Test and Measurement<br />Custom Software Engineering & Embedded Systems<br />Microsoft SharePoint Consulting Services<br />
  7. 7. Relevant Siemens Projects<br />Dulles Airport Transit Tunnel Ventilation System<br /><ul><li>WinCC Redundancy
  8. 8. S7 400H Redundant PLC
  9. 9. 4000 I/O Points</li></li></ul><li>Relevant Siemens Projects<br />Batch Mixing Systems for Confectionary Company<br /><ul><li>S7-300
  10. 10. Standardized code base
  11. 11. Deployment at multiple facilities
  12. 12. Mixing/batching control
  13. 13. Recipe management
  14. 14. Web-based reporting system</li></li></ul><li>Relevant Siemens Projects<br />Automotive Assembly Lines for Tier 1 Supplier<br /><ul><li>S7 400 PLC’s
  15. 15. WinCC Flex HMI’s
  16. 16. Standardized code base
  17. 17. User Configurable
  18. 18. JIT - Lean Manufacturing
  19. 19. Deployment at multiple facilities </li></li></ul><li>Relevant Siemens Projects<br />US Navy LCS-1 <br />Littoral Combat Ship<br /><ul><li>S7 400H Redundant PLC
  20. 20. Mission Critical Logic</li></li></ul><li>Presenter Info<br />Tim Jager<br />Project Director at DMC<br />Mechanical Engineer (University of Illinois)<br />Licensed Professional Engineer in Illinois<br />With DMC since 1999<br />
  21. 21. Top 10 S7 Mistakes<br />#1<br />Page 12<br />Simple Hardware mistakes<br />
  22. 22. Common Hardware Mistakes<br />Page 13<br />My PLC Doesn’t Work???<br />
  23. 23. Common Hardware Mistakes<br />Page 14<br />My PLC Doesn’t Work???<br />It needs a memory card<br />
  24. 24. Common Hardware Mistakes<br />Page 15<br />My PLC Doesn’t Work???<br />It needs a memory card<br />It’s in STOP Mode<br />
  25. 25. Common Hardware Mistakes<br />Page 16<br />I wonder what’s on the MMC Card?<br />
  26. 26. Common Hardware Mistakes<br />Page 17<br />I wonder what’s on the MMC Card?<br />
  27. 27. Common Hardware Mistakes<br />Page 18<br />I wonder what’s on the MMC Card?<br />
  28. 28. Common Hardware Mistakes<br />Page 19<br />
  29. 29. Common Hardware Mistakes<br />Page 20<br />This is not an RS232 Serial Port!!!<br />
  30. 30. Top 10 S7 Mistakes<br />#2<br />Page 21<br />Using Absolute Address Priority instead of Symbolic<br />
  31. 31. Set your Address Priority to Symbolic<br />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.<br />Page 22<br />
  32. 32. A Typical Data Block<br />DB1 “dbGlobals”<br />Page 23<br />
  33. 33. A Typical Data Block<br />DB1 “dbGlobals”<br />Page 24<br />Symbol Name: <br />“dbGlobals”.bStart<br />Address: <br />DB1.DBX0.0<br />
  34. 34. A Typical Rung Of Ladder<br />Page 25<br />
  35. 35. A Typical Rung Of Ladder<br />Page 26<br />Address Logic<br />Symbolic Logic<br />
  36. 36. A Typical Rung Of Ladder<br />Page 27<br />Address Logic<br />Symbolic Logic<br />
  37. 37. What happens if we change the Data Block?<br />Page 28<br />
  38. 38. Absolute vs. Symbolic Priority<br />Page 29<br />In Symbolic Mode the intended logic is maintained<br />The address logic has changed from 0.1 to 0.2 <br />The symbolic logic is maintained <br />
  39. 39. Absolute vs. Symbolic Priority<br />Page 30<br />In Absolute Mode the intended logic is NOT maintained!<br />The Address logic is maintained <br />But the Symbolic logic is totally wrong! <br />
  40. 40. Absolute vs. Symbolic Priority<br />Page 31<br />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.<br />So start forgetting about addresses and start thinking about symbolic names. <br />VS.<br />Absolute Address<br />2222N. Elston Ave<br />Chicago, IL 60614<br />Symbolic Address<br />tim.jager@dmcinfo.com<br />
  41. 41. Top 10 S7 Mistakes<br />#3<br />Page 32<br />I/O Mapping<br />
  42. 42. …I'm gonnaProgram… like it's 1999<br />Page 33<br />Input / Output Mapping<br />
  43. 43. Traditional Input / Output Mapping<br />Page 34<br />1. At the beginning of the scan, Each physical input gets mapped to an internal variable…<br />Physical Input<br />Internal Variable<br />
  44. 44. Traditional Input / Output Mapping<br />Page 35<br />1. At the beginning of the scan, Each physical input gets mapped to an internal variable…<br />2. Now run all of the logic (which references only internal bits)…<br />Internal Variable<br />Internal Variable<br />
  45. 45. Traditional Input / Output Mapping<br />Page 36<br />1. At the beginning of the scan, Each physical input gets mapped to an internal variable…<br />2. Now run all of the logic (which references only internal bits)…<br />3. …At the end of the scan, internal “output” bits get mapped to physical outputs<br />Internal Variable<br />Physical Output<br />
  46. 46. Page 37<br />S7 I/O Mapping – Just use the Symbol Table<br />Make sure you are in Symbolic Priority Mode<br />
  47. 47. Top 10 S7 Mistakes<br />#4<br />Page 38<br />Improper Use of Bit Memory<br />AKA: Mbits<br />
  48. 48. MBits<br />M0.0 – M0.7<br />M1.0 – M1.7<br />M2.0 – M2.7<br />M2.0 – M2.7<br />Page 39<br />
  49. 49. MBits<br />MBytes<br />M0.0 – M0.7<br />MB0<br />M1.0 – M1.7<br />MB1<br />M2.0 – M2.7<br />MB2<br />MB3<br />M2.0 – M2.7<br />Page 40<br />
  50. 50. MBits<br />MBytes<br />MWords<br />M0.0 – M0.7<br />MB0<br />MW0<br />M1.0 – M1.7<br />MB1<br />M2.0 – M2.7<br />MB2<br />MW1<br />MB3<br />M2.0 – M2.7<br />Page 41<br />
  51. 51. MBits<br />MBytes<br />MWords<br />MDoubleWords<br />M0.0 – M0.7<br />MB0<br />MW0<br />M1.0 – M1.7<br />MB1<br />MD0<br />M2.0 – M2.7<br />MB2<br />MW1<br />MB3<br />M2.0 – M2.7<br />Page 42<br />
  52. 52. When is it OK to use M Bits?<br /><ul><li>Debugging
  53. 53. Quick prototyping / demonstrations
  54. 54. When you absolutely have to!</li></ul>Page 43<br />
  55. 55. When is it OK to use M Bits?<br />Page 44<br /><ul><li>Critical / Time-sensitive field fixes*</li></ul>M-Bits<br />* As long as you promise to put in a permanent fix when the heat is off.<br />
  56. 56. When is it OK to use M Bits?<br />Page 45<br />If you use MBits, make sure they are NOT IN USE already.<br />
  57. 57. When is it OK to use M Bits?<br />..and make sure to add symbol names in the symbol table.<br />Page 46<br />
  58. 58. When is it OK to use M Bits?<br />Or suffer the consequences……<br />Page 47<br />
  59. 59. When is it OK to use M Bits?<br /><ul><li>Clock Byte</li></ul>Page 48<br />
  60. 60. Top 10 S7 Mistakes<br />#5<br />Page 49<br />Not using or Improperly using the Clock Byte<br />
  61. 61. What is the Clock Byte?<br />Page 50<br />Each bit of the clock memory byte is assigned a frequency.<br />
  62. 62. Symbol Table Entry For Clock Byte<br />Page 51<br />Reserve these so nobody uses Memory overlapping the Clock Byte<br />
  63. 63. Clock Byte<br />Page 52<br />The bits within the Clock byte can change at any time during the scan.<br />
  64. 64. Clock Byte – Synchronous Global<br />Page 53<br />UDT1 “udtClockByte”<br />
  65. 65. Clock Byte – Synchronous Global<br />Page 54<br />DB1 “dbGlobals”<br />
  66. 66. Clock Byte – Synchronous Global<br />Page 55<br />DB1 “dbGlobals”<br />
  67. 67. Clock Byte – Synchronous Global<br />Page 56<br />DB1 “dbGlobals”<br />
  68. 68. Clock Byte – Synchronous Global<br />Page 57<br />MB0<br />dbGlobals.ClockByte<br />
  69. 69. Page 58<br />What Happens If…… <br />“Always_False”<br />Mapped to M0.0<br />“Always_True”<br />Mapped to M0.1<br />
  70. 70. Page 59<br />What Happens If…… <br />“Always_False”<br />Mapped to M0.0<br />“Always_True”<br />Mapped to M0.1<br />Clock Byte <br />Mapped to MB0<br />
  71. 71. Overlapping Mbits are BAD!<br />Page 60<br />
  72. 72. Top 10 S7 Mistakes<br />#6<br />Page 61<br />Using Uninitialized Temp Memory<br />
  73. 73. What is Temp Memory?<br />Page 62<br />
  74. 74. Improper Use of Temp Memory<br />Page 63<br />
  75. 75. Improper Use of Temp Memory<br />Page 64<br />Don’t read from a TEMP unless you have written to it first!<br />
  76. 76. Top 10 S7 Mistakes<br />#7<br />Page 65<br />Not Using Timed Interrupts.<br />
  77. 77. OB1 vs. OB30..38<br />Page 66<br />OB1 <br />Runs as fast as it can.<br />OB30…OB38 <br />Run at specific time intervals.<br />
  78. 78. Timed Interrupts OB30..OB38<br />Page 67<br />PID Control<br />Data Sampling<br />
  79. 79. Top 10 S7 Mistakes<br />#8<br />Page 68<br />Not using reusable function blocks<br />
  80. 80. What is a Function Block <br /><ul><li>A Function Block is a piece of reusable code that consists of:
  81. 81. Code is encapsulated in a Highly reusable form
  82. 82. Increases Programming efficiency and reduces errors </li></li></ul><li>TON<br />IN<br />Q<br />T#200ms<br />PT<br />ET<br />178<br />One of the simplest and most commonly used function block is a Timer.<br />Timer <br />
  83. 83. Creation of Function Block<br />Isolate Common/Duplicate Code<br />If the same code is used many times in your program, consider creating function blocks.<br />
  84. 84. Creation of Function Block<br />Isolate Common/Duplicate Code<br />Step 1. locate common code.<br />
  85. 85. Creation of Function Block<br />Isolate Common/Duplicate Code<br />Step 1. locate common code.<br />
  86. 86. Creation of Function Block<br />Isolate Common/Duplicate Code<br />Step 2. Replace duplicated code with function blocks.<br />
  87. 87. Valve<br />FB<br />Custom FB Examples<br />Motor<br />FB<br />Pump<br />FB<br />Cylinder<br />FB<br />Robot Interface<br />FB<br />Barcode Scanner<br />FB<br />Label Printer<br />FB<br />Machine Vision<br />FB<br />
  88. 88. Top 10 S7 Mistakes<br />#9<br />Page 76<br />Inconsistent Blocks<br />
  89. 89. Check Block Consistency<br />Page 77<br />Don’t forget to download the Data Block!!<br />
  90. 90. Top 10 S7 Mistakes<br />Page 78<br />And last but not least……..<br />
  91. 91. Top 10 S7 Mistakes<br />#10<br />Page 79<br />Going it Alone<br />
  92. 92. Thank You!<br />Page 80<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×