2011 Automation Summit  Orlando, FL   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 Page
DMC Company Profile Page  Established in 1996, based in Chicago, IL Service Companies Nationally & Globally Siemens Solution Partner Global Reach:  Canada China Georgia Czech Rep. Russia Philippines Mexico India
Bio Nick Shea Senior Project Engineer at DMC Engineering Physics  (University of Kansas) With DMC since 2006 Page
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? Page
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?  Page
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? Page
Top Ten S7 Tips and Tricks Now… take your development to the next Level! Page
Top Ten S7 Tips and Tricks Tips and Tricks for: Rapid Diagnostics / Troubleshooting Rapid Development Advanced Tools Page
Modular, Object-Oriented Architecture with FBs and UDTs #1
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
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
Modular, Object-Oriented Architecture with FBs and UDTs System Architecture
Modular, Object-Oriented Architecture with FBs and UDTs Program Architecture (similar to system architecture!)
Modular, Object-Oriented Architecture with FBs and UDTs Example of High-Level Function Block:
Modular, Object-Oriented Architecture with FBs and UDTs Example of Device Level Function Block utilizing UDTs:
Modular, Object-Oriented Architecture with FBs and UDTs Variables encapsulated by udtHMI_VFD_Control
Modular, Object-Oriented Architecture with FBs and UDTs Variables encapsulated by udtErrors_VFD
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
Monitoring Instances of Function Blocks #2
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. Page  Default is Process mode.  Switch to Test Mode. Download the hardware configuration.
Monitoring Instances of Function Blocks This option is also shown in the Debug -> Operation dropdown menu from the Ladder Editor  Page
Monitoring Instances of Function Blocks Right-click on the block and select “Monitor with Call-Up Path” Process Mode   Test Mode Page
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. Page
Report System Error #3
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 displayed in WinCC flexible? Page
Report System Error End Result: No (0) programming required! Page
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! Page
RAM Disk #4
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 3 rd  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. Page
Auto-Generate Symbol Table #5
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. Page
Auto-Generate Symbol Table Page
Using Local Memory to Parse Data #6
Using Local Memory to Parse Data Split data types into smaller pieces without using ST or SCL. Assign a variable to TEMP memory. Move data into the TEMP memory variable. Page
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. Page
Network Node Activating, Deactivating, and Monitoring #7
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 Page
Network Node Activating, Deactivating, and Monitoring Monitoring Ethernet Nodes using “RDSYSST”  SFC51 Page
Safety Programming #8
Safety Programming Leverage Siemens safety blocks Page
Safety Programming Safety program can be really simple or really complicated depending on the application. Example of implementing simple E-Stop safety functionality: Page
Safety Programming Always ON and OFF variables available inside “F_GLOBDB” datablock. Page
Backup DB Data by Generating Source #9
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. Page
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. Go online with all of the blocks in Simatic Manager.  Copy the online version of the data block whose values you would like to retain into your offline project. Add the items to end of the data block. Download - your values will be retained. Page
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. Follow steps 1 and 2 above. 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.  Page
Backup DB Data by Generating Source Make all changes that you need to the data block (not source code) then Save and Close the data block. 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.  Download - your values have been retained.  Page
Keyboard Shortcuts #10
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 Page
Keyboard Shortcuts Development Shortcuts New Empty Rung / Network: Ctrl-R Normally open contact: F2 Normally closed contact: F3 Coil: F7 Empty Box: Alt-F9 Page
Keyboard Shortcuts Monitoring / Diagnostics / Other Shortcuts Monitor: Ctrl-F7 Module Information: Ctrl-D Page
Keyboard Shortcuts Monitoring / Diagnostics / Other Shortcuts Operating Mode: Ctrl-I Download: Ctrl-L Page
Summary
Summary – Top Ten S7 Tips and Tricks Modular, Object-Oriented Architecture with FBs and UDTs Monitoring Instances of Function Blocks Report System Error RAM Disk Auto-Generate Symbol Table Network Node Activating, Deactivating, and Monitoring Safety Programming Basics Using Local Memory to Parse Data Backup DB Data by Generating Source Keyboard Shortcuts Page
Thank You Nick Shea [email_address] www.dmcinfo.com Page

Top Ten Siemens S7 Tips and Tricks

  • 1.
    2011 Automation Summit Orlando, FL Navigating the world of automation
  • 2.
    2011 Automation SummitTitle: Top Ten S7 Tips and Tricks Track: NAPR Topic: S7 PLCs Presenter: Nick Shea Company: DMC Page
  • 3.
    DMC Company ProfilePage Established in 1996, based in Chicago, IL Service Companies Nationally & Globally Siemens Solution Partner Global Reach: Canada China Georgia Czech Rep. Russia Philippines Mexico India
  • 4.
    Bio Nick SheaSenior Project Engineer at DMC Engineering Physics (University of Kansas) With DMC since 2006 Page
  • 5.
    Top Ten S7Tips 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? Page
  • 6.
    Top Ten S7Tips 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? Page
  • 7.
    Top Ten S7Tips 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? Page
  • 8.
    Top Ten S7Tips and Tricks Now… take your development to the next Level! Page
  • 9.
    Top Ten S7Tips and Tricks Tips and Tricks for: Rapid Diagnostics / Troubleshooting Rapid Development Advanced Tools Page
  • 10.
  • 11.
    Modular, Object-Oriented Architecturewith FBs and UDTs Best Practices for Controls Design – Generally Accepted Consistent Design and Documentation Mechanical Design Electrical Schematics P&IDs Software
  • 12.
    Modular, Object-Oriented Architecturewith FBs and UDTs Best Practices for Controls Design… also includes: PLC and HMI Projects Naming conventions Hardware architecture Modular Software Architecture Function Blocks UDTs
  • 13.
    Modular, Object-Oriented Architecturewith FBs and UDTs System Architecture
  • 14.
    Modular, Object-Oriented Architecturewith FBs and UDTs Program Architecture (similar to system architecture!)
  • 15.
    Modular, Object-Oriented Architecturewith FBs and UDTs Example of High-Level Function Block:
  • 16.
    Modular, Object-Oriented Architecturewith FBs and UDTs Example of Device Level Function Block utilizing UDTs:
  • 17.
    Modular, Object-Oriented Architecturewith FBs and UDTs Variables encapsulated by udtHMI_VFD_Control
  • 18.
    Modular, Object-Oriented Architecturewith FBs and UDTs Variables encapsulated by udtErrors_VFD
  • 19.
    Modular, Object-Oriented Architecturewith 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.
    Monitoring Instances ofFunction Blocks #2
  • 21.
    Monitoring Instances ofFunction Blocks There are two PLC modes and they are toggled in the CPU Properties on the “Protection” tab: Process Mode and Test Mode. Page Default is Process mode. Switch to Test Mode. Download the hardware configuration.
  • 22.
    Monitoring Instances ofFunction Blocks This option is also shown in the Debug -> Operation dropdown menu from the Ladder Editor Page
  • 23.
    Monitoring Instances ofFunction Blocks Right-click on the block and select “Monitor with Call-Up Path” Process Mode Test Mode Page
  • 24.
    Monitoring Instances ofFunction 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. Page
  • 25.
  • 26.
    Report System ErrorSiemens 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 displayed in WinCC flexible? Page
  • 27.
    Report System ErrorEnd Result: No (0) programming required! Page
  • 28.
    Report System Error10 easy steps: (website has screenshots and full instructions) Create S7 and HMI stations . Add languages . Set “English” as default Open the &quot;Report System Error...&quot; 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! Page
  • 29.
  • 30.
    RAM Disk Whencompiling an S7 project, many small files are read and written. RAM Disk is RAM that is used as a disk drive – via 3 rd 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. Page
  • 31.
  • 32.
    Auto-Generate Symbol TableThe 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. Page
  • 33.
  • 34.
    Using Local Memoryto Parse Data #6
  • 35.
    Using Local Memoryto Parse Data Split data types into smaller pieces without using ST or SCL. Assign a variable to TEMP memory. Move data into the TEMP memory variable. Page
  • 36.
    Using Local Memoryto Parse Data Split data types into smaller pieces without using ST or SCL. 3. Access the TEMP or Local memory using the “L” prefix. Page
  • 37.
    Network Node Activating,Deactivating, and Monitoring #7
  • 38.
    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 Page
  • 39.
    Network Node Activating,Deactivating, and Monitoring Monitoring Ethernet Nodes using “RDSYSST” SFC51 Page
  • 40.
  • 41.
    Safety Programming LeverageSiemens safety blocks Page
  • 42.
    Safety Programming Safetyprogram can be really simple or really complicated depending on the application. Example of implementing simple E-Stop safety functionality: Page
  • 43.
    Safety Programming AlwaysON and OFF variables available inside “F_GLOBDB” datablock. Page
  • 44.
    Backup DB Databy Generating Source #9
  • 45.
    Backup DB Databy 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. Page
  • 46.
    Backup DB Databy 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. Go online with all of the blocks in Simatic Manager.  Copy the online version of the data block whose values you would like to retain into your offline project. Add the items to end of the data block. Download - your values will be retained. Page
  • 47.
    Backup DB Databy 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. Follow steps 1 and 2 above. 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.  Page
  • 48.
    Backup DB Databy Generating Source Make all changes that you need to the data block (not source code) then Save and Close the data block. 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.  Download - your values have been retained.  Page
  • 49.
  • 50.
    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 Page
  • 51.
    Keyboard Shortcuts DevelopmentShortcuts New Empty Rung / Network: Ctrl-R Normally open contact: F2 Normally closed contact: F3 Coil: F7 Empty Box: Alt-F9 Page
  • 52.
    Keyboard Shortcuts Monitoring/ Diagnostics / Other Shortcuts Monitor: Ctrl-F7 Module Information: Ctrl-D Page
  • 53.
    Keyboard Shortcuts Monitoring/ Diagnostics / Other Shortcuts Operating Mode: Ctrl-I Download: Ctrl-L Page
  • 54.
  • 55.
    Summary – TopTen S7 Tips and Tricks Modular, Object-Oriented Architecture with FBs and UDTs Monitoring Instances of Function Blocks Report System Error RAM Disk Auto-Generate Symbol Table Network Node Activating, Deactivating, and Monitoring Safety Programming Basics Using Local Memory to Parse Data Backup DB Data by Generating Source Keyboard Shortcuts Page
  • 56.
    Thank You NickShea [email_address] www.dmcinfo.com Page