Top Ten Siemens S7 Tips and Tricks

103,031 views
102,692 views

Published on

DMC, a Siemens Solution Partner with the most S7 Certified Engineers in the United States, recently shared some 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
3 Comments
38 Likes
Statistics
Notes
No Downloads
Views
Total views
103,031
On SlideShare
0
From Embeds
0
Number of Embeds
572
Actions
Shares
0
Downloads
3,030
Comments
3
Likes
38
Embeds 0
No embeds

No notes for slide

Top Ten Siemens S7 Tips and Tricks

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

×