Home
Testing Your S7 Programs with S7
Contents
1. Note Always enter drive C as the destination drive for the authorization for S7 PLCSIM Testing Your S7 Progams with S7 PLCSIM 2 2 C79000 G7076 C201 02 Installing the S7 PLCSIM Software Removing an Authorization If you should need to repeat the authorization for example if you want to reformat the drive on which the authorization is located you must remove the existing authorization first You need the original authorization disk to do this To transfer the authorization back to the authorization disk follow the steps outlined below 1 Insert the original authorization disk in your floppy disk drive 2 Start the program AUTHORSW EXE from the authorization disk 3 From the list of all authorizations on drive C select the authorization to be removed 4 Select the menu command Authorization gt Transfer 5 In the dialog box enter the target floppy drive to which the authorization will be transferred and confirm the dialog box 6 The window with the list of authorizations remaining on the drive is then displayed Close the AUTHORSW program if you do not want to remove any more authorizations You can then use the disk again to install an authorization If Your Hard Drive Is Defective If a fault occurs on your hard disk before you can back up the authorization contact your local Siemens representative Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 2 3 Installing the S7 PLCSIM
2. The default value is IBO for input byte 0 Press ENTER to accept 2 Create a view object that accesses the outputs used by the program Select the menu command Insert gt Output Variable The default value is QBO for output byte 0 Press ENTER to accept 3 Create three view objects to access the timers used by the program Select the menu command Insert gt Timer The default value is T 0 with the O highlighted Type 2 in the view object for Timer T 2 and press ENTER Repeat for timers T 3 and T 4 E S7 PLCSIM Zebra pic I x Simulation Edit Insert PLC Execute View Options Window Help fc bal eof wel fl ne E cPu 30040 Hal SF FA RUN P RUN M STOP MRES Ready MPI 2 NUM yy Figure 3 3 View Objects for the S7_ZEBRA Sample Program Testing Your S7 Progams with S7 PLCSIM 3 4 C79000 G7076 C201 02 Getting Started with S7 PLCSIM 3 3 Running the Sample Program Selecting the Execution Option With the sample program downloaded to the CPU you can now run the program Before starting the program ensure that the program execution is set for continuous scan Use the menu command Execute gt Scan Mode gt Continuous Scan or click on the toolbar button shown in Fi
3. 0 eee nennen een een Table B 1Memory Areas for the S7 300 and S7 400 CPUs Table B 2Data Formats for the Variables View Object 0005 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Product Overview 1 Overview The S7 PLCSIM software enables you to run and test your program on a simulated PLC that exists on your computer or programming device such as a PG 740 Because the simulation exists completely within the STEP 7 software you do not need to be connected to any S7 hardware CPU or I O modules With the simulated S7 CPU you can test and debug programs for both the S7 300 and S7 400 CPUs S7 PLCSIM provides a simple interface for monitoring and modifying different parameters used by the program such as for turning inputs on and off You can also use the various applications of the STEP 7 software while you are running your program on the simulated CPU This allows you to use such tools as the variable table VAT to monitor and modify variables Section Description Page 1 1 Features of S7 PLCSIM 1 2 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 1 1 Product Overview 1 1 Features of S7 PLCSIM S7 PLCSIM offers the following features for running a program on a simulated PLC A button on the SIMATIC Manager toolbar turns the simulation on or off Turning on the simulation button opens the S7 PLCSIM software with its simulate
4. S7 format B 4 Sample program running 3 5 3 6 Saving a layout of view objects 3 6 the PLC a Scan modes RA Showing symbol names 5 7 SIMATIC Manager selecting the simulator 4 2 Simulation session turning on and off 4 2 Simulator button SIMATIC Manager 4 2 Simulator options continuous scan 4 3 Pause 4 3 single scan mode Single scan mode 4 3 Stacks 4 4 5 10 Starting the program 3 5 Status indicators LEDs 5 2 Status word 5 8 STEP 7 manuals iv STEP 7 tools disconnect before closing CPU monitoring logic execution variable table VAT 3 7 4 5 STOP mode changing the CPU mode to 5 2 CPU indicator 5 2 Stop mode before resetting CPU memory MRES 5 3 Symbol names for addresses 5 7 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 System fault SF CPU indicator 5 2 System function blocks SFBs supported 1 3 System functions SFCs supported 1 3 T Technical assistance Timer area of memory description B 2 Timers accessing timer data 5 4 creating execution times 1 3 resetting 3 6 Toolbar buttons in PLCSIM window 3 5 4 4 in SIMATIC Manager 3 2 Uninstalling PLCSIM 2 5 Using STEP 7 tools 3 7 3 8 V Variable table monitoring and modifying the program Variables modifying data 5 7 Variables view object data formats B 4 VAT See Variable table View object accessing data in memory 5 4 5 7 accumulators block regist
5. memory bits and timer elements in the ladder networks as shown in Figure 3 9 LAD STL FDB S7_ZEBRA SIMATIC 300 STATION 1 CPU 314 1 FC1 lt On line gt fe EI NA Determining green request for pedestrians Determining whether I 0 0 or I 0 1 is set 10 0 T6 TS MO 0 TEIL MO O Network 2 Green phase for cars If I 0 0 or I 0 1 are not set the light stays green for cars Ss oO oO AS Y 2 wa HZ Figure 3 9 Monitoring Program Status in the Ladder View Testing Your S7 Progams with S7 PLCSIM 3 8 C79000 G7076 C201 02 Running a Program on the Simulated PLC Overview 4 S7 PLCSIM works with the STEP 7 software to test and debug your program on a simulated PLC This chapter describes how to start the S7 PLCSIM download a program select execution options and access data in the program Section Description Page 4 1 Starting the S7 PLCSIM 4 2 4 2 Selecting the Simulation Options 4 3 4 3 Accessing Data in the Simulated PLC 4 4 4 4 Opening Saving and Closing the Simulated PLC 4 6 4 5 Using Interrupt OBs in Your Program 4 8 a I ST PLCS 1 Running a Program on the Simulated PLC 4 1 Starting the S7 PLCSIM You use the SIMATIC Manager to open a simulated PLC Selecting Simulation 4 2 STEP 7 provides a button on the SIMATIC Manager toolbar that opens the simulated PLC of S7 PLCSIM Because of the
6. I O and program errors can be simulated Differences between a Simulated PLC and a Real PLC The simulated PLC provides the following capabilities which are not available in a real PLC e The Pause function halts the simulated CPU and allows you to resume the execution of the program at the instruction where the program was halted e Any change that you make with a view object immediately updates the contents of the memory location The CPU does not wait until the beginning or the end of the scan to update any changed data Execution options allow you to select how the CPU runs the program Single Scan executes the program for one scan and then waits for you to start the next scan Continuous Scan executes the program like a real PLC it starts a new scan immediately after the previous one finishes e Changing the CPU view object to STOP mode does not change the state of the outputs You can allow the timers to run automatically or you can choose to enter values for the timers manually You can also reset the timers to 0 For Single Scan mode the timers function in manual mode only e You can manually trigger the interrupt OBs OB40 to OB 47 hardware interrupt OB80 time error OB82 diagnostic interrupt OB83 insert remove module OB85 priority class error and OB86 DP slave or rack failure To simulate I O interrupt events the simulator must have a valid I O configuration Using S7 PLCSIM with a Proc
7. S7 Reference Information Overview B S7 PLCSIM provides view objects for accessing the information stored in the simulated CPU You can access any ofthe memory areas using the standard S7 STEP 7 notation for entering the memory addresses This appendix provides descriptions of the memory areas accumulators and address registers It also provides a quick reference for the different formats for displaying or modifying the data Section Description Page B 1 Memory Areas for the S7 300 and S7 400 CPUs B 2 B 2 S7 PLCSIM Notation for Entering Data B 4 Testing Your S7 Progams with S7 PLCSIM B 1 C79000 G7076 C201 02 S7 Reference Information B 1 Memory Areas for the S7 300 and S7 400 CPUs Figure B 1 shows the memory areas accumulators address registers and the status word for the S7 300 and S7 400 CPUs S7 PLCSIM uses the view objects to access the values stored in the simulated CPU Table B 1 describes the different memory areas CPU Accumulators and Registers Memory Areas Accumulators 32 bits Peripheral I O PI PQ Accumulator1 ACCU 1 Outputs Q Accumulator2 ACCU 2 Inputs I Accumulator3 ACCU 3 S7 400 only Bit Memory M Accumulator4 ACCU4 S7 400 only Timers T Counters C Address Registers 32 bits Address Register 1 AR1 Data blocks DB Address Register2 AR2 in the executable user program Data Block Registers 32 bits DB number f
8. The software is therefore copy protected and can be used only if the relevant authorization for the program or software package has been found on the hard disk of the respective programming device or personal computer Authorization Disk A read only authorization disk is included with the software It contains the authorization and the program AUTHORSW required to display install and remove the authorization For more information and rules on how to handle authorizations see the STEP 7 User Manual N Caution Note the information in the README WRI file on the authorization disk If you do not adhere to these guidelines the authorization may be irretrievably lost Installing the Authorization for the First Time When installing your software for the first time a message prompts you to install the authorization Follow the steps outlined below 1 When prompted insert the authorization disk in drive A 2 Acknowledge the prompt The authorization is transferred to a physical drive and your computer registers the fact that the authorization has been installed Adding an Authorization at a Later Date If you attempt to start the S7 PLCSIM software and there is no authorization available for the software a message informs you of this If you want to install the authorization use the AUTHORSW program on the authorization disk This program allows you to display install and remove authorizations The program is menu driven
9. buttons as shown in Figure 4 2 These options control the execution of the program e Continuous Scan The CPU executes one complete scan and then starts another scan Each scan consists of the CPU reading the inputs executing the program and then writing the results to the outputs Single Scan The CPU executes one scan and then waits for you to initiate another scan Each scan consists of the CPU reading the inputs executing the program and then writing the results to the outputs Using the Pause Function The Pause function allows you to halt the execution of a program temporarily Unlike placing the CPU into STOP mode which restarts the execution of the program at the first instruction in your program when you return to RUN mode halting the execution of a program lets you resume the execution at the instruction where you halted the program You can turn the Pause function on and off with the Execute gt Pause menu command or you can use the toolbar button as shown in Figure 4 2 Cycling Power On and Off You can simulate turning power on and off for the CPU This allows you to check the different startup OBs Use the PLC gt Power Off Power On menu commands to cycle power fe of Zug Next Scan Resets all of the Single Scan Pause timers Continuous Scan Figure 4 2 Toolbar Buttons for Program Execution Options Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 4 3 Running a Program
10. of memory B 2 changing operating modes 5 3 cycling power at disconnect STEP 7 tools before closing 4 4 indicators 5 2 memory areas 5 4 memory reset MRES 5 3 opening a CPU view object 4 6 operating modes 5 3 resetting the memory MRES using a variable table CPU scan continuous scan single scan mode Creating view objects Cycling Power D Data block DB 5 9 description as area of memory B 2 Data formats B 4 Decimal data format B 4 Diagnostic information 1 4 se ae between simulated and real PLCs 1 4 Disconnecting STEP 7 tools before closing CPU 4 4 Downloading a program 4 6 selecting the simulator 4 2 E Entering data B 4 Errors during installation 2 5 Execution control selecting type of 4 3 47 Exiting the application F Features supported 1 2 1 3 Index 1 Index H Halting the program effect of Pause on STEP 7 tools 4 4 Pause 4 3 Hexadecimal data format B 4 O memory supported 1 3 Input area of memory description B 2 Inputs setting bits 3 5 5 7 turning on and off Installation error overview Installing PLCSIM Integer format B 4 L L Stack description of temporary local memory 2 2 Ladder logic program monitoring status 3 8 Layout of view objects saving 36 LEDs status indicators 5 2 Logic blocks supported M Manuals STEP 7 set iv Master control relay See MCR stack MCR stac
11. on the Simulated PLC 4 3 Accessing Data in the Simulated PLC You can access data in the simulated PLC with the view objects provided by the main S7 PLCSIM window or with the standard STEP 7 tools for monitoring program status or a combination of both Using the S7 PLCSIM View Objects View objects allow you to monitor the program by displaying the values or the states of the variables used by the program Some view objects are read only others allow you to change the values of specific memory locations S7 PLCSIM provides view objects for the following types of data Variable data This view object allows you to display or modify the values of timers counters I O bits or other memory locations The following view objects can provide useful information for debugging a program when used with the breakpoint function in STEP 7 e Accumulators and the status word The read only ACCUs amp Status Word view object accesses the contents of the accumulators and the values stored in the pointer address registers AR1 and AR2 It also displays the states of the status word bits e Block registers The read only Block Regs view object accesses the contents of the data block address registers DB1 and DB2 It also displays the identity of the logic block being executed and the step address counter SAC e Stacks nesting stack and MCR stack The read only Stacks view object accesses the contents of the nesting s
12. organized if you uninstall any older versions before installing the new version Overwriting an old version with a new version has the disadvantage that if you then uninstall any remaining components of the old version are not removed During installation queries are shown in dialog boxes for you to answer and options are displayed for you to select Read the following notes so you can reply to the queries faster and more easily Testing Your S7 Progams with S7 PLCSIM 2 4 C79000 G7076 C201 02 Installing the S7 PLCSIM Software Uninstalling Use the usual Windows 95 or Windows NT procedure to uninstall 1 Start the dialog box for installing software under Windows 95 or Windoes NT by double clicking on tne Add Remove Programs icon in the Control Panel 2 Select the SIMATIC S7 PLCSIM entry in the displayed list of installed software Click on the Add Remove button to uninstall the software 3 If the Remove Enable File dialog boxes appear click the No button if you are unsure how to respond Memory Requirement for Languages and Examples All languages of the user interface and all examples require approximately 8 Mbytes of memory capacity Authorization Requirement During installation the program checks to see whether an authorization is installed on the hard disk If no authorization is found a message appears that the software can be used only with an authorization You can run the authorization progra
13. state of the outputs e In RUN mode the CPU executes the program As with a real CPU you cannot download any new programs or logic blocks when the CPU view object is in RUN mode You can use the STEP 7 tools to monitor but not to modify the variables e In RUN P mode the CPU executes the program When the CPU view object is in RUN P mode you can download new programs or logic blocks and you can modify the variables with the STEP 7 tools To change the CPU mode click on the box for STOP RUN or RUN P The CPU status indicators show whether the CPU is in RUN or RUN P mode or in STOP mode Resetting the CPU Memory MRES The CPU view object provides an MRES button for resetting the memory of the CPU When you reset the CPU memory the simulated CPU performs the following tasks e The memory areas are reset e The program blocks are deleted To reset the CPU memory click on the MRES button or select the menu command PLC gt Clear Reset Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 5 3 Monitoring and Modifying Data with the View Objects 5 2 Monitoring and Modifying the Data Used by the Program You can create view objects that access the data stored in the different memory areas of the simulated CPU S7 PLCSIM provides view objects that contain default addresses for a timer a counter a bit memory location an input and an output You can also create a generic view object to access the data stored in
14. the memory at the beginning of each scan PQ peripheral external output The CPU writes the Q memory to the PQ memory at the end of every scan process image input The memory area is overwritten by the Pl memory area at the beginning of every scan Q process image output The Q memory area overwrites the PQ memory area at the end of each scan M bit memory The M memory area provides storage for interim results calculated in the program Testing Your S7 Progams with S7 PLCSIM 5 4 C79000 G7076 C201 02 Monitoring and Modifying Data with the View Objects Table 5 1 Memory Areas for the S7 300 and S7 400 CPUs continued Memory Area Description T timer The T memory area provides the timers used by the program C counter The C memory area stores the counter values used by the program DB data block The DB memory address references the data stored in the data blocks for the program Creating View Objects for Accessing the Program Data To create view objects for monitoring and modifying the data used by the program use the Insert menu commands Figure 5 2 shows several examples of the view objects Use the following procedure to access a memory address with a view object 1 Enter the memory address to be accessed and press ENTER For example IBO accesses byte 0 of the Input memory area and T 2 accesses timer 2 2 Use the drop down list box to select the appropriate
15. you can perform the following functions Change the CPU operating mode STOP RUN and RUN P Reset the CPU memory MRES Displaying the Status of the CPU The CPU view object provides the following indicators like LEDs that display the CPU status 5 2 SF system fault indicates an error condition DP distributed peripherals or remote I O indicates the status of communication with distributed remote I O DC power supply indicates that power to the CPU is on RUN indicates that the CPU is in RUN mode STOP indicates that the CPU is in STOP mode For more information about the S7 300 and S7 400 CPUs refer to the System Software for S7 300 and S7 400 Program Design Programming Manual or to the online help for STEP 7 EI cPu 300400 Hal I RUN P Dc v RUN STOP MRES CPU operating mode controls CPU status indicators Figure 5 1 CPU View Object Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Monitoring and Modifying Data with the View Objects Changing the CPU Operating Mode The check boxes on the CPU view object allow you to change the CPU operating modes e In STOP mode the CPU is not executing the program To download a program that includes SDBs or to change the node address you must place the CPU in STOP mode Unlike the case with a real CPU placing the CPU view object in STOP mode does not change the
16. 0ms TOD Time of Day D 2 34 45 330 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Downloading System Data to S7 PLCSIM C Overview If you want to simulate interrupt OBs in S7 PLCSIM you must first correctly download your I O configuration If your project matches either of the following descriptions certain modifications are required to download your hardware configuration to S7 PLCSIM e An S7 300 project with any CPU other than the CPU 315 2 DP e An S7 400 project that uses DP I O with a CP instead of using a CPU model that explicitly supports DP I O Note Projects configured for a CPU 315 2 DP or for an S7 400 CPU that explicitly supports DP do not require the modifications that are described in this appendix Section Description Page C4 Modifying and Downloading Your I O Configuration Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 C 1 Downloading System Data to S7 PLCSIM C 1 Modifying and Downloading Your I O Configuration Interrupt OBs Require a Valid I O Configuration In order to simulate interrupt OBs you must download a hardware configuration that contains your I O There are some cases where your I O is not automatically included in the system data that STEP 7 downloads to S7 PLCSIM S7 300 CPUs Only the CPU 315 2 DP downloads an I O configuration all of the other S7 300 CPUs autoconfigure the I O to match the physical I O installed in the ra
17. 3 2 Setting Up the Simulated PLC 3 4 3 3 Running the Sample Program 3 5 3 4 Using STEP 7 Tools to Monitor the Program 3 7 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 3 1 Getting Started with S7 PLCSIM 3 1 Opening a Simulated PLC and Downloading the Sample Program Opening the S7 PLCSIM PLC Use the following procedure to open the simulator 1 Start the SIMATIC Manager 2 Open the S7 PLCSIM PLC by clicking on the Simulation On Off button located on the SIMATIC Manager toolbar as shown in Figure 3 1 or by selecting the menu command Options gt Simulate Modules The S7 PLCSIM application window opens with a default CPU view object SIMATIC Manager S7_ZEBRA x File Edit Insert PLC View Options Window Help Dialer Xe dal Sah Bf A Simulation On Off button E S7 PLCSIM Zebra plc Simulation Edit Insert PLC Execute View Options Window Help RUN P RUN v STOP _MRES Ready MPI 2 NUM f Figure 3 1 Using the Simulation On Off Button to Open the Simulated PLC Testing Your S7 Progams with S7 PLCSIM 3 2 C79000 G7076 C201 02 Getting Started with S7 PLCSIM Downloading the Program Use the following procedure to download the sample program 1 Use the SIMATIC Manager menu command File gt Open gt Project or click on the Open Project Library butt
18. AT that is being prepared as an interface Figure 4 3 shows a sample VAT for tne S7_ZEBRA program Address Symbol Monitor Format Monitor Value Modify Value Switch right left 190 smena BOOL Swich lef BOOL Gr Qutputs cars pedestrians oar orange pras Smar mme Tsstfoms Ped green pras SIMATIOTIME __ S5T 0ms Poardelay eh emare rme __ S5T 0ms Car red_ovange praso SMATIO_TIME __ S5T 0ms Ped_delay_green SIMATIC_TIME S5T 0ms Figure 4 3 Example of a STEP 7 Variable Table VAT Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 4 5 Running a Program on the Simulated PLC 4 4 Opening Saving and Closing the Simulated PLC You can save and re open a simulated PLC You can also save and re open the layout of the view objects that you inserted Opening a Simulated PLC You can open a simulated PLC in one of the following ways e From STEP 7 with no project open click on the Simulation On Off button to start the S7 PLCSIM software e Use the Start menu Start gt SIMATIC gt STEP 7 S7 PLCSIM Simulating Modules to start the S7 PLCSIM software Note S7 PLCSIM supports only one simulated PLC at a time You have two options for loading a program into the simulated PLC e You can download a program from the SIMATIC Manager or the program editor e If you have already saved one or more simulated PLCs to a file you can open a specif
19. CSIM Timers now measure real time and not simulated increments Writing to the Input I and output Q memory areas now writes also to the peripheral input Pl and peripheral output PQ memory areas Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Product Overview In addition to these enhancements the following features have been added to S7 PLCSIM version 4 Additional S7 data types Char Date S5Time and Time Of Day Additional SFBs and SFCs Alarm and Scan support for WinCC Windows Command Center SFC CFC and PCS7 Clock memory Connection to WinAC Computing version 1 2 or higher Priority classes OBs User generated events to trigger interrupt OBs Other features such as an Always on Top function an undo function sort by absolute address and scrollbars have also been added PLC Functions Supported The simulated PLC functions as a superset of the S7 300 and S7 400 CPUs It provides the following capabilities Timers 512 TO to T 511 Memory bits up to 16 384 bits 2048 bytes of M memory Total addressable I O memory up to 16 384 bytes 16 Kbytes of I O memory Process image updated every scan as determined by the hardware configuration in the system data downloaded from STEP 7 S7 PLCSIM simulates a process image of either 512 bytes or 1024 bytes Logic blocks and data blocks 65 536 function blocks FBs and functions FCs and 65 535 data blocks DBs System
20. CUs amp Status Word Accumulators 100 0 0 Address Registers 0 0 Status Word 8 o DOO PT AON i cc1 BR CC 0 OV OS OR Figure 5 4 Accumulators and Status Word View Object Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Monitoring and Modifying Data with the View Objects 5 5 Monitoring the Block Registers Displaying the Contents of the Block Registers You can view the contents ofthe data and logic block registers by opening the Block Regs view object Select the menu command View gt Block Registers to open this view object Figure 5 5 shows the Block Regs view object For more information about the block registers for the S7 300 and S7 400 CPUs refer to the System Software for S7 300 and S7 400 Program Design Programming Manual or to the online help for STEP 7 Gi Block Regs oix Data Block Figure 5 5 Block Registers View Object Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 5 9 Monitoring and Modifying Data with the View Objects 5 6 Monitoring the Data in the CPU Stacks Monitoring the Nesting Stack and the MCR Stack The Stacks view object displays the status of both the nesting stack and the master control relay MCR stack These stacks help you to monitor the stat
21. DP I O but your CPU does not directly support DP you must copy your hardware configuration into an S7 400 CPU with a DP extension and download it to S7 PLCSIM from the DP station See Appendix C for information about creating a project to hold your hardware configuration for the purpose of downloading I O information to S7 PLCSIM Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Monitoring and Modifying Data with the View Objects Overview S7 PLCSIM provides view objects that allow you to display the following information Variable data such as timers counters inputs and outputs e Accumulators and status word e Address registers Block registers e Nesting stack and MCR stack Any change made by a view object affects the program immediately When you use a STEP 7 variable table to change a value the CPU reads that change at the beginning of the next scan Section Description Page 5 1 Controlling the CPU 5 2 5 2 Monitoring and Modifying the Data Used by the Program 5 4 5 3 Displaying the Symbolic Addresses 5 7 5 4 Accessing the Accumulators Status Word and Address Registers 5 5 Monitoring the Block Registers 5 6 Monitoring the Data in the CPU Stacks 5 10 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 5 1 Monitoring and Modifying Data with the View Objects 5 1 Controlling the CPU Figure 5 1 shows a sample CPU view object From this view object
22. SIEMENS SIMATIC Testing Your S7 Programs with S7 PLCSIM User Manual C79000 G7076 C201 Edition 02 Preface Contents Product Overview Installing the S7 PLCSIM Software Getting Started with S7 PLCSIM Running a Program on the Simulated PLC Monitoring and Modifying Data with the View Objects Appendices Troubleshooting S7 Reference Information Downloading System Data to S7 PLCSIM ndex A OO N O1 i O Safety Guidelines This manual contains notices which you should observe to ensure your own personal safety as well as to protect the product and connected equipment These notices are highlighted in the manual by a warning triangle and are marked as follows according to the level of danger Danger IN precautions are nottaken indicates that death severe personal injury or substantial property damage will result if proper Warning IN precautions are nottaken indicates that death severe personal injury or substantial property damage can result if proper Caution IN indicates that minor personal injury or property damage can result if proper precautions are not taken Qualified Personnel The device system may only be set up and operated in conjunction with this manual Only qualified personnel should be allowed to install and work on this equipment Qualified persons are defined as persons who are authorized to commission to ground and to tag circuits
23. Software 2 2 Installing and Uninstalling the S7 PLCSIM Software S7 PLCSIM includes a Setup program which executes the installation automatically Prompts on the screen guide you step by step through the installation procedure Preparing for Installation Before you can start installing the software the STEP 7 basic package must be loaded Starting the Installation Program The Setup program guides you step by step through the installation process You can switch to the next step or to the previous step from any position To start the installation program proceed as follows 1 Start the dialog box for installing software under Windows 95 or Windows NT by double clicking on tne Add Remove Programs icon in the Control Panel 2 Click on Install 3 Insert disk 1 and click on Next Windows searches automatically for the installation program SETUP EXE 4 Follow the instructions displayed by the installation program step by step If a Version of S7 PLCSIM Is Already Installed If the installation program finds another version of S7 PLCSIM on the programming device the program reports this and prompts you to decide how to proceed by offering the following choices e Abort the installation so that you can uninstall the old S7 PLCSIM version under Windows 95 or Windows NT and then start the installation again e Continue the installation and overwrite the old version with the new version Your software is better
24. Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 4 7 Running a Program on the Simulated PLC 4 5 4 8 Using Interrupt OBs in Your Program Note For the simulated PLC to run a program for an interrupt OB you must have created and downloaded the interrupt OB Furthermore to simulate the l O related interrupts you must have successfully downloaded your I O configuration You can use S7 PLCSIM to test how your program handles different interrupt OBs S7 PLCSIM supports simulation of the following interrupt OBs e OB40 to OB47 hardware interrupt e O B80 time error e OB82 diagnostic interrupt e OB83 insert remove module e OB85 priority class error e OB86 DP slave or rack failure For more information about the interrupt OBs refer to the S7 300 and S7 400 System and Standard Functions Reference Manual or to the online help for STEP 7 Use the menu command Execute gt Trigger Error OB to select a specific OB and enter the header information in the dialog box When you click on the OK button the simulated PLC generates the appropriate event and runs the program in the associated OB Note S7 PLCSIM grays out the interrupt OB menu selection if an I O configuration has not been successfully downloaded For S7 300 users this means that you must use a CPU 315 2 DP project to download the hardware configuration even if your CPU is actually a different model For S7 400 users if you use
25. a to S7 PLCSIM IN 4 Copy the central rack from your Hardware Configuration Caution Be certain only to copy not cut from the configuration of your original project to the configuration of the SIM_IO project If you cut items from your original configuration your Hardware Configuration will not work in real field applications any more 5 Leaving the Hardware Configuration of your project open navigate back to the SIM_IO project and open its Hardware Configuration 6 Paste the central rack from your original configuration into the SIM_IO configuration 7 Inthe SIM_IO configuration edit the rack to replace the existing CPU If the existing CPU is an S7 300 replace it with a CPU 315 2 DP If the existing CPU is an S7 400 replace it with a CPU that directly supports DP The extension DP should appear in the name of the model that you select Note When you insert a new CPU in the central rack the STEP 7 hardware configuration software issues a series of messages prompting you to assign a network If your original project was not networked answer No to these prompts The STEP 7 hardware configuration software displays the message Cannot assign a PROFIBUS network to the DP master Since you do not need a PROFIBUS network this message is not a problem 8 If your configuration previously used a CP for DP communications delete the CP from the SIM_IO configuration The CP is not nece
26. art up an S7 300 S7 400 PLC The manuals for the programming language packages Statement List Ladder Logic and SCL Structured Control Language contain both the user s guide and the reference description of the programming language or representation type 1 Optional package for system software for S7 300 S7 400 Additional Assistance If you have any questions not answered in this or one of the other STEP 7 manuals if you need information on ordering additional documentation or equipment or if you need information on training please contact your Siemens distributor or sales office Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Contents 1 Product Overview rens 2 0 ee ee un 1 1 Features of S7 PLCSIM 00 cece eee eet eee 2 Installing the S7 PLCSIM Software 000 ccc e cence eee eens 2 1 Authorization v d ecsedeiermeed eheussed tiere kuchen ade 2 2 Installing and Uninstalling the S7 PLCSIM Software 3 Getting Started with S7 PLCSIM 0 cece eee eee eee eee 3 1 Opening a Simulated PLC and Downloading the Sample Program 3 2 Setting Up the Simulated PLC 0 00 c cece eee eee 3 3 Running the Sample Program 2 0 cece cece eee eee 3 4 Using STEP 7 Tools to Monitor the Program 00e0ee0 4 Running a Program on the Simulated PLC 00eeeeee eee 4 1 Starting the S7 PLCSIM 0 0 cece cee tne 4 2 Selecting the Simu
27. ck To successfully download I O to S7 PLCSIM you must copy your hardware configuration and put the data into a CPU 315 2 DP project When you download the I O information from the CPU 315 2 DP project you can simulate interrupt OBs in S7 PLCSIM and S7 PLCSIM is also able to detect any I O referencing errors that your program may contain S7 400 CPUs If you use a CP with PROFIBUS DP I O rather than using a CPU model that explicitly supports DP you cannot download this I O configuration and use it to simulate an interrupt OB in S7 PLCSIM However you can copy your I O configuration into a second project and replace the S7 400 CP and CPU with an S7 400 CPU model that explicitly supports DP Once you download the hardware configuration from this second project to S7 PLCSIM you can simulate interrupt OBs and detect I O referencing errors Modifying Your Hardware Configuration for S7 PLCSIM To successfully download an I O configuration to S7 PLCSIM you must use either a CPU 315 2 DP or an S7 400 CPU that directly supports DP I O Use the following procedure to create and modify a copy of your hardware configuration 1 Insert a new SIMATIC station to hold the modified configuration that you are going to create Name it something descriptive such as SIM_IO 2 Navigate to your project 3 Open the Hardware Configuration of your project C 2 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Downloading System Dat
28. d PLC When the S7 PLCSIM software is running all communication from STEP 7 goes to the simulated PLC It does not matter whether your program is intended for either an S7 300 or an S7 400 CPU module you can use the simulated PLC to test programs for any S7 CPU module You can create view objects that allow you to access the input and output memory areas accumulators and registers of the simulated CPU You can modify any of this data You can choose to have the timers run automatically or you can set or reset the timers manually You can reset individual timers or you can reset all of the timers at once You can change the CPU operating mode STOP RUN and RUN P as with a real CPU In addition S7 PLCSIM provides a Pause function that allows you to halt the CPU momentarily without affecting the state of the program You can simulate interrupt OBs The single scan feature allows you to test your program one scan at a time S7 PLCSIM also allows you to use all of the STEP 7 tools to monitor and modify the activities of the simulated PLC New Features for S7 PLCSIM Version 4 There have been several enhancements to S7 PLCSIM A slider control has been added to the options for displaying data Use the slider to enter analog values or other values for byte word or double word memory locations The slider control provides configurable minimum and maximum values The STEP 7 toolbar button now opens and closes S7 PL
29. e changes of individual instructions in your program e The nesting stack stores up to seven entries For each entry the nesting stack stores the states of the RLO and OR bits of the status word for the And A And Not AN Or O Or Not ON Exclusive Or X and Exclusive Or Not XN instructions e The MCR stack stores up to eight levels of nesting for an MCR To create the view object for viewing the nesting stack and the MCR stack use the View gt Stacks menu command Figure 5 6 shows the Stacks view object Refer to the Statement List STL for S7 300 and S7 400 Programming Manual for more information about the nesting stack and the MCR stack Bice OF x Nesting Stack MCR C MAbit RLO RLO OR NO of WDM CO Figure 5 6 Stacks View Object Testing Your S7 Progams with S7 PLCSIM 5 10 C79000 G7076 C201 02 Troubleshooting Table A 1 Troubleshooting Problem Your program does not download to the simulated PLC Possible Cause Verify that the CPU is in either STOP mode or RUN P mode As with a real CPU you cannot download your program if the simulated CPU is in RUN mode Also you cannot download your program when the simulated CPU is in Pause mode If your program contains the hardware configuration for the PLC verify
30. enter such as binary decimal or hexadecimal Enter the value in the text field in the corresponding format and press ENTER Displaying the Symbolic Addresses You can display the symbol names assigned to the absolute addresses in any of the view objects of your simulated PLC To establish a link to the symbol table associated with the downloaded program follow these steps 1 Select the menu command Options gt Attach Symbols 2 Use the browser dialog box to select the symbol table associated with the downloaded program 3 Click on the OK button to confirm the selection The menu command Options gt Show Symbols toggles the symbolic representation on and off for all of the view objects Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 5 7 Monitoring and Modifying Data with the View Objects 5 4 5 8 Accessing the Accumulators Status Word and Address Registers You can display the contents ofthe accumulators the status word and the address registers in the CPU by opening the ACCUs amp Status Word view object Select the menu command View gt Accumulators to open this view object Figure 5 4 shows the ACCUs amp Status Word view object For more information about the status word and the accumulators for the S7 300 and S7 400 CPUs refer to the System Software for S7 300 and S7 400 Program Design Programming Manual or to the online help for STEP 7 1 1 2 AC
31. equipment and systems in accordance with established safety practices and standards Correct Usage Warning Note the following This device and its components may only be used for the applications described in the catalog or the technical description and only in connection with devices or components from other manufacturers which have been approved or recommended by Siemens This product can only function correctly and safely if it is transported stored set up and installed correctly and operated and maintained as recommended Trademarks SIMATIC SIMATIC HMI and SIMATIC NET are registered trademarks of SIEMENS AG Microsoft and Visual Basic are registered trademarks and ActiveX is a trademark of Microsoft Corporation Some of the other designations used in these documents are also registered trademarks the owners rights may be violated if they are used by third parties for their own purposes Copyright Siemens AG 1998 All rights reserved The reproduction transmission or use of this document or its contents is not permitted without express written authority Offenders will be liable for damages All rights including rights created by patent grant or registration of a utility model or design are reserved Siemens AG Bereich Automatisierungs und Antriebstechnik Geschaeftsgebiet Industrie Automatisierungssysteme Postfach 4848 D 90327 Nuernberg Disclaimer of Liability We have checked the conten
32. ers CPU 4 6 5 2 saving the PLC 4 6 stacks variable 4 4 Index 3 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Siemens AG A amp D ASE 46 Oestliche Rheinbrueckenstr 50 D 76181 Karlsruhe Federal Republic of Germany From Your Name Your Title Company Name Street City Zip Code Country Phone Please check any industry that applies to you O Automotive O Pharmaceutical O Chemical O Plastic O Electrical Machinery Pulp and Paper O Food O Textiles J Instrument and Control Transportation O Nonelectrical Machinery O Other Petrochemical Testing Your S7 Programs with S7 PLCSIM C79000 G7076 C201 02 Remarks Form Your comments and recommendations will help us to improve the quality and usefulness of our publications Please take the first available opportunity to fill out this questionnaire and return it to Siemens Please give each of the following questions your own personal mark within the range from 1 very good to 5 poor Do the contents meet your requirements Is the information you need easy to find Is the text easy to understand Does the level of technical detail meet your requirements ER Ten Da re Please rate the quality of the graphics tables Additional comments Testing Your S7 Programs with S7 PLCSIM 2 C79000 G7076 C201 02 Seiten be
33. ers programmers and maintenance personnel who have a general knowledge of programmable logic controllers Scope of the Manual This manual describes the features and the operation of S7 PLCSIM version 4 In order to install S7 PLCSIM you must have an authorized version of STEP 7 installed on your computer Testing Your S7 Progams with S7 PLCSIM A C79000 G7076 C201 02 Il Preface Other Manuals You can find information in the online help for STEP 7 and for S7 PLCSIM In addition the following manuals provide information about STEP 7 Title Content System Software for S7 300 and S7 400 Program Design Programming Manual S7 300 and S7 400 System and Standard Functions Reference Manual STEP 7 User Manual Statement List Ladder Logic STGRAPH SCL and FBD Manuals The System Software for S7 300 S7 400 Program Design Programming Manual provides basic information on the structure of the operating system and of a user program of an S7 CPU The S7 CPUs have integrated system functions and organization blocks included with their operating system which you can use when programming This manual provides you with descriptions of the system functions organization blocks and loadable standard functions available in S7 The STEP 7 User Manual explains the main usage and the functions of the STEP 7 automation software This manual provides you with an overview of the procedures used to configure program and st
34. ess Simulation Program S7 PLCSIM provides an ActiveX control S7ProSim that allows you to attach a process simulation program to the simulated PLC You can use the S7ProSim Control with any application that supports Microsofts OLE COM technology such as Visual Basic version 5 0 For more information about the properties methods and events of the S7ProSim Control refer to the documentation that was installed with the S7 PLCSIM software Use the following path to display the documentation Siemens Step7 S7manual S7wsi S7wspms x pdf where x indicates the language a German b English c French d Spanish and e ltalian Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Installing the S7 PLCSIM Software Overview 2 The Setup program guides you through the installation of the S7 PLCSIM software by means of dialog boxes and menus You call the Setup program using the standard Windows 95 or Windows NT software installation procedure Refer to the Readme file for information about the system requirements and the versions of STEP 7 that support S7 PLCSIm version 4 Section Description Page 2 1 Authorization 2 2 2 2 Installing and Uninstalling the S7 PLCSIM Software 2 4 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 2 1 Installing the S7 PLCSIM Software 2 1 Authorization The S7 PLCSIM programming software requires a product specific authorization or license for use
35. f Button to Open the Simulated PLC Figure 3 2 Downloading the S7_ZEBRA Program to the Simulated PLC Figure 3 3 View Objects for the S7_ZEBRA Sample Program Figure 3 4 Selecting Continuous Scan Program Execution 4 3 5 Figure 3 5 Selecting RUN Mode 0 ec cece annanru annnars Figure 3 6 Turning On Input 10 0 0 0 cece ete eee Figure 3 7 Sample View Objects Showing Status in RUN Mode 3 6 Figure 3 8 Example of a STEP 7 Variable Table VAT 0000ee eee Figure 3 9 Monitoring Program Status in the Ladder View 4 Figure 4 1 Selecting S7 PLCSIM with the SIMATIC Manager Figure 4 2 Toolbar Buttons for Program Execution Options Figure 4 3 Example of a STEP 7 Variable Table VAT 0000 0 00s Figure 5 1 CPU View Object een ee Figure 5 2 Variable View Objects sussesuesaurnrun nrun rannen 5 5 Figure 5 3 Configuring the Slider Control aasssusa aae cece eee eee eee Figure 5 4 Accumulators and Status Word View Object 2 055 Figure 5 5 Block Registers View Object 00 cece cece een nenn Figure 5 6 Stacks View Object 000 cece eee eee eee renee Figure B 1 Memory Areas for the S7 300 and S7 400 CPUs Tables vi Table 5 1 Memory Areas for the S7 300 and S7 400 CPUs Table A 1 Troubleshooting
36. ffect only the values that can be entered or displayed by the slider control Selecting a range of values provides the following benefits e You can simulate a specific range of values For example this allows you to simulate the range of values that would be generated by a specific analog module By limiting the range of values between the minimum and maximum you can provide better resolution for entering data with the slider You can always enter an exact value in the Value field of the view object MD 0 oy x Select the slider control and representation of data Select the minimum and maximum values for the slider control Figure 5 3 Configuring the Slider Control Testing Your S7 Progams with S7 PLCSIM 5 6 C79000 G7076 C201 02 Monitoring and Modifying Data with the View Objects Using the View Objects to Modify Data 5 3 Use the following guidelines to modify data in the view objects e When you select bit format for a variable such as an input byte the eight check boxes correspond to bits 0 through 7 To activate any of the bits in the view object click on the corresponding check box to change the state from off to on 0 to 1 A check mark appears indicating a state of 1 on Clear the check box to turn the bit off For variables that you specify as bytes words or double words use the drop down list box to select the appropriate representation for the data that you want to
37. function blocks SFBs SFBO SFB1 SFB2 SFB3 SFB4 SFB5 SFB16 SFB32 SFB33 SFB34 SFB35 SFB36 and SFB37 Note that SFB16 PRINT is a NOP does not perform any operation You do not have to modify a program that calls SFB16 System functions SFCs SFCO SFC1 SFC2 SFC3 SFC4 SFC5 SFC6 SFC9 SFC10 SFC13 SFC14 SFC15 SFC17 SFC18 SFC19 SFC20 SFC21 SFC22 SFC23 SFC24 SFC26 SFC27 SFC28 SFC29 SFC30 SFC31 SFC32 SFC33 SFC34 SFC39 SFC40 SFC41 SFC42 SFC43 SFC44 SFC46 SFC47 SFC49 SFC50 SFC51 SFC52 SFC54 SFC55 SFC56 SFC57 SFC58 SFC59 SFC64 SFC79 and SFC80 For SFC26 and SFC27 the only input parameter supported is 0 OBs OB1 free cycle OB10 to OB17 time of day interrupt OB20 to OB23 time delay interrupt OB30 to OB38 cyclic interrupt OB40 to OB47 hardware interrupt OB80 time error OB82 diagnostic interrupt OB83 insert remove interrupt OB85 priority class error OB86 rack failure OB100 complete restart OB101 restart OB121 programming error and OB122 access error Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 1 3 Product Overview Limitations of the Simulated PLC S7 PLCSIM has the following limitations e You can run only one simulated PLC at a time e The simulated PLC does not support all of the error messages written to the diagnostic buffer For instance bad batteries in the CPU or EPROM errors cannot be simulated However most
38. gure 3 4 to select the execution control option for running the program continuously A I 1 Click here for Continuous Scan program execution Figure 3 4 Selecting Continuous Scan Program Execution Starting the Program Use the following procedure to switch the CPU into RUN mode and start the program 1 Click the RUN check box in the CPU view object See Figure 3 5 Ei cPu 300400 BEA Click here to switch the CPU to RUN mode Dc v RUN STOP MRES Figure 3 5 Selecting RUN Mode 2 Click either bit O or bit 1 in the Input Variable view object to turn on 0 0 or I 0 1 as shown in Figure 3 6 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 3 5 Getting Started with S7 PLCSIM Click here to turn on input bit 0 0 Figure 3 6 Turning On Input I 0 0 In the view objects you can watch the timer values as they change and the outputs as they turn on or off as shown in Figure 3 7 As each timer reaches its preset value the corresponding outputs turn on or off To speed up the operation of the sample program you can reset the timers by clicking on the T 0 button in each Timer view object Saving the Layout of View Objects You can save your layout of view objects within the simulated PLC window by selecting the menu co
39. ic PLC by using the Simulation Open PLC menu command Saving the Simulated PLC Use the Simulation Save PLC or the Simulation Save PLC As menu command to archive a simulated PLC The following elements are saved with the PLC e Program e CPU operating mode RUN P RUN or STOP e Power state on or off e Execution control option continuous scan or single scan e The status of the I O e Timer values Testing Your S7 Progams with S7 PLCSIM 4 6 C79000 G7076 C201 02 Running a Program on the Simulated PLC Saving the Layout of View Objects To save the layout of the view objects you have inserted for the simulated PLC select the menu command Simulation gt Save Layout Any time you reopen a saved simulated PLC you can also open a saved layout using the Simulation gt Open Layout menu command Closing the Simulated PLC You can close a PLC either by selecting the Simulation Close PLC menu command or by clicking on the exit button in the top right corner of the CPU view object Closing the simulated PLC ends the simulation of the program but does not exit the S7 PLCSIM application Note When you close the simulated PLC S7 PLCSIM provides a dialog box that allows you to save the PLC This dialog box allows you to save only the PLC it does not save the layout before closing both the PLC and the layout To save the layout select the menu command Simulation Save Layout before closing the simulated PLC
40. k Memory areas Memory bits supported Memory reset MRES Modes changing CPU operation Monitoring and modifying data Monitoring and modifying the program using a variable table 3 7 4 5 using view objects MPI address See Node address MRES See Memory reset MRES Nesting stack Index 2 Node address only one PLC at a time 4 6 turning the power off before changing 4 3 Opening a PLC 4 6 Opening a layout 3 6 Operating modes changing CPU 5 3 Options simulation Error OBs supported 1 3 Interrupt OBs supported Organization blocks OBs supported Output area of memory description B 2 Outputs accessing Q and PQ memory Overview installation 2 1 product features 1 1 P Pause function 4 3 with STEP 7 tools 4 4 Peripheral input and output areas of memory accessing 5 4 description PLC closing 4 7 downloading a program 4 6 opening 4 6 Opening a PLC 4 6 saving configuration 4 6 PLCSIM errors during installation 2 5 installation 2 4 Power on off CPU indicator 5 2 cycling power Process image Product overview Program editor monitoring status 3 8 R Real number format B 4 Resetting the CPU memory 5 3 Resetting timers 3 6 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Index RUN mode changing the CPU mode to 5 2 CPU indicator 5 2 Running a program 3 5 3 6 RUN P mode changing the CPU mode to 5 2 S
41. lation Options 00 0 cece eee eee eee 4 3 Accessing Data in the Simulated PLC 0 0 cece eee eee 4 4 Opening Saving and Closing the Simulated PLC 4 5 Using Interrupt OBs in Your Program 0 2 0c eee eee e eee 5 Monitoring and Modifying Data with the View Objects 2 5 5 1 Controlling the CPU 6 ee eee eens 5 2 Monitoring and Modifying the Data Used by the Program 5 3 Displaying the Symbolic Addresses 000 cece eee eens 5 4 Accessing the Accumulators Status Word and Address Registers 5 5 Monitoring the Block Registers 0 cece eee eee eee 5 6 Monitoring the Data in the CPU Stacks 0 0 c eee eee eee A Troubleshooting senusenenenen nennen nennen nennen nenn B S7 Reference Information 0 0cceee eee eee nn nenn nun nn nenn B 1 Memory Areas for the S7 300 and S7 400 CPUs B 2 S7 PLCSIM Notation for Entering Data 00 cee seen Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 B X E o N al al ele LLL ele e ee e A N o 0o fF O N Nol B Po gt m oe h o oo N w Kop Contents Cc Downloading System Data to S7 PLCSIM 00 cece eee eee eee C 1 C 1 Modifying and Downloading Your I O Configuration C 2 INDOX 8s sidG tied E ee a ee Figures Figure 3 1 Using the Simulation On Of
42. lease take the first available opportunity to fill out this questionnaire and return it to Siemens Please give each of the following questions your own personal mark within a range from 1 very good to 5 very poor Do the contents meet your requirements Is the information you need easy to find Is the text easy to understand Does the level of technical detail meet your requirements Se ze Please rate the quality of the graphics and tables Additional comments Testing Your S7 Programs with S7 PLCSIM PR C79000 G7076 C201 02
43. m immediately or continue the installation and execute the authorization at a later date See Section 2 1 for a description of how to run the authorization program Result of the Installation Once the installation has been completed successfully a message to that effect is displayed on the screen If Errors Occur during the Installation The following errors may cause the installation to fail e Initialization error immediately after starting Setup The SETUP EXE program was probably not started under Windows 95 or Windows NT e Not enough memory You need at least 8 Mbytes of free space on your hard disk e Bad disk Verify that the installation disk is bad then call your local Siemens representative e Operator error Start the installation again and read the instructions carefully Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 2 5 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Getting Started with S7 PLCSIM Overview STEP 7 provides a sample program called S7_ZEBRA You can use this program to become familiar with the features of the S7 PLCSIM software This chapter provides the basic steps for downloading and running the program on a simulated CPU It also provides information about using the different view objects and a variable table VAT with the simulation Section Description Page 3 1 Opening a Simulated PLC and Downloading the Sample 3 2 Program
44. mmand Simulation gt Save Layout You can then retrieve the saved layout at any time by selecting the menu command Simulation gt Open Layout Fl S7 PLCSIM Zebra pic f x Simulation Edit Insert PLC Execute View Options Window Help E cPu 30040 Hall Fr RUN P Ready RUN STOP MRES ei Nm Figure 3 7 3 6 Sample View Objects Showing Status in RUN Mode Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Getting Started with S7 PLCSIM 3 4 Using STEP 7 Tools to Monitor the Program Using a Variable Table to Monitor or Modify Data STEP 7 allows you to use a variable table VAT to monitor the status of any variable in your program Figure 3 8 shows a VAT for the sample program You can also modify the variables which are defined for the VAT To monitor program status using the variable table follow these steps 1 2 You can now observe the values of the input output and timer elements in the Access the SIMATIC Manager window Select VAT1 and double click with the mouse or use the menu command Edit gt Open Object to open the variable table for the S7_ZEBRA project Monitor Value column of the VAT as shown in Figure 3 8 Select the menu command PLC Connect To Co
45. nfigured CPU to establish an online connection with the program in the simulated PLC Select the menu command Variable gt Monitor to start monitoring the program data Address Symbol Monitor Format Monitor Value Modify Value Switch right left E BOLT E mot Outputs cars pedestrians Pere poo af Feigen feo area ec TT Sarorange feo Sagen feo oar orange phase Smar mme Tsstfoms Ped green pras emare mme estams Poardelay rer emare mme estams Car red orange praso smAro nme __ S5T 0ms Ped_delay_green SIMATIC_TIME S5T 0ms Figure 3 8 Example of a STEP 7 Variable Table VAT Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 3 7 Getting Started with S7 PLCSIM Using the Program Editor to Monitor Status To view the execution of program logic in the ladder view of the program follow these steps 1 Access the SIMATIC Manager window 2 Select FC1 in the online view and double click with the mouse or use the menu command Edit Open Object to open the program for the S7_ZEBRA project If necessary select View gt LAD in the LAD STL FBD application to switch from the statement list view to the ladder view 3 Select the menu command Debug gt Monitor to enable the animation of program execution in the ladder networks You can now observe the power flow to the inputs outputs
46. on to open the S7_ZEBRA project This project is supplied with the STEP 7 software 2 Navigate through the object hierarchy until you get to the blocks object Figure 3 2 shows the S7_ZEBRA project structure 3 Select the menu command PLC gt Download or click on the Download button to download the blocks object to the simulated CPU SIMATIC Manager S7_ZEBRA File Edit Insert PLC View Options Window Help SR S7_ZEBRA HB SIMATIC 300 Station a CPU314 1 isd 7 Program 1 Download button H Source Files H Tere ZEBRA blocks object Press F1 for Help NUM v7 Figure 3 2 Downloading the S7_ZEBRA Program to the Simulated PLC Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 3 3 Getting Started with S7 PLCSIM 3 2 Setting Up the Simulated PLC Creating View Objects for the Sample Program The S7_ZEBRA sample program uses several inputs outputs and timers You can use view objects to turn the inputs on and off and you can watch the timer values and outputs change as the program runs Figure 3 3 shows the view objects used with the sample program Use the following procedure to create the different view objects 1 Create a view object that accesses the inputs used by the program Select the menu command Insert Input Variable
47. or the open DB DB number for the open instance DB DI Status Word Status bits 16 bits Figure B 1 Memory Areas for the 87 300 and S7 400 CPUs B 2 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 S7 Reference Information Table B 1 Memory Areas for the S7 300 and S7 400 CPUs Name Memory Area Function of Memory Area Input I Process image At the beginning of the scan cycle the operating system reads input table the inputs from the process and records the values in this table The program uses these values in its normal processing For every CPU cycle input memory stores the state of the inputs in the process image input table The process image input table maps the first 512 bytes of the peripheral input memory Output Q Process image During the scan cycle the program calculates output values output table and places them in this table At the end of the scan cycle the operating system reads the calculated output values from this table and sends them to the process outputs The process image output table maps the first 512 bytes of the peripheral output memory Bit memory M Memory bits This area provides storage for interim results calculated in the program You designate whether the data are to be accessed as bits bytes words etc Peripheral input VO Peripheral memory allows direct access to the field devices PI external inputs physical or ex
48. other memory areas Accessing the Data Stored in the CPU Memory The view objects that you create with the Insert menu commands allow you to monitor and modify those values and immediately see the effect on your program When you change a value in a data field press ENTER for it to be accepted You can use these view objects to access the inputs and outputs the timers counters and the data used by the program Table 5 1 lists the memory areas that can be accessed For more information about the memory areas refer to the System Software for S7 300 and S7 400 Program Design Programming Manual or to the online help for STEP 7 Note The peripheral input Pl memory area overwrites the input I memory area at the beginning of every CPU scan If you use a view object to modify a value in the memory area the simulator immediately copies that value to the peripheral memory This ensures that the desired input value is not overwritten at the beginning of the next scan Likewise the output Q memory area writes to the peripheral output PQ memory area at the end of every CPU scan if you use a view object to modify a value in the peripheral PQ memory area the simulator immediately writes the desired value to the output Q memory area so that the value is not lost at the end of the scan Table 5 1 Memory Areas for the S7 300 and S7 400 CPUs Memory Area Description PI peripheral external input The CPU writes the PI memory to
49. representation for the data that will be displayed or entered such as binary decimal or hexadecimal E DB5 DBB oy x DB5 DBB 0 Decimal yj Slider Re v en 0 000 Value Y 0 Figure 5 2 Variable View Objects Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 5 5 Monitoring and Modifying Data with the View Objects Using the Slider Control The slider control allows you to simulate values that change gradually or have a specific range such as analog values Figure 5 3 shows a slider control You can use either the mouse or the arrow keys to change the position of the slider control Changing the position of the slider control changes the value of the variable stored in the memory location You can also enter a specific value in the Value field When you select the slider control you also select whether to represent the values as either decimal positive integers integer positive and negative integers or real numbers The selection options are determined by the size of the memory location being accessed e Byte B decimal e Word W decimal and integer e Double word D decimal integer and real You can also configure a minimum and maximum value for the slider control Selecting a range of values does not affect the values that can be stored in the variable the minimum and maximum values a
50. risk of unintentionally editing a real online program you cannot start a simulation session until you close all windows or applications that are connected to real PLCs STEP 7 disables the Simulator On Off button whenever a project is open whether on line or off line To enable the Simulator On Off button close all STEP 7 project windows Clicking on the Simulator On Off button opens the S7 PLCSIM software with a simulated PLC You can also use this button to close the S7 PLCSIM software Figure 4 1 shows the SIMATIC Manager window with the Simulation On Off button Note You can have only one simulated PLC active at a time When the Simulation On Off button is turned on clicking on the Accessible Nodes button shows the node address for the simulated PLC that you have created When the Simulation On Off button is turned off the Accessible Nodes window shows the network of real PLCs SIMATIC Manager S7_ZEBRA Eile View PLC Options Window Help nejem xe al ae Sfr le ee Simulation On Off button Press F1 for Help NUM J Figure 4 1 Selecting S7 PLCSIM with the SIMATIC Manager Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Running a Program on the Simulated PLC 4 2 Selecting the Simulation Options Selecting the Execution Options You select the program execution options with the Execute menu commands You can also access these options with the toolbar
51. rsicht f r 203 Brosch re S7 PLCSIM Programmtest mit simulierter S7 CPU Seiten bersicht Innentitel Vorderseite Innentitel R ckseite mit Copyright Preface Contents Product Overview Installing the S7 PLCSIM Software Vakatseite Getting Started with S7 PLCSIM Running a Program on the Simulated PLC Monitoring and Modifying Data with the View Objects Troubleshooting Vakatseite S7 Reference Information Downloading System Data to S7 PLCSIM Vakatseite Index Vakatseite Benutzervorschl ge Testing Your S7 Programs with S7 PLCSIM C79000 G7076 C201 02 vi 1 1 1 4 2 1 2 5 3 1 3 8 4 1 4 8 5 1 5 10 A 1 B 1 B 4 C 1 C 3 Index 1 Index 3 Testing Your S7 Programs with S7 PLCSIM C79000 G7076 C201 02 To SIEMENS ENERGY amp AUTOMATION INC ATTN TECHNICAL COMMUNICATIONS M S 519 3000 BILL GARLAND ROAD PO BOX 1255 JOHNSON CITY TN USA 37605 1255 From Name Job Title Company Name Street City and State Please check any industry that applies to you Automotive Chemical Electrical Machinery Food Instrument and Control 0000 000 Non electrical Machinery vo 10200 Petrochemical Testing Your S7 Programs with S7 PLCSIM C79000 G7076 C201 02 Pharmaceutical Plastic Pulp and Paper Textiles Transportation Other Remarks Form Your comments and recommendations will help us to improve the quality and usefulness of our publications P
52. ssary after you put a DP CPU into the configuration 9 If you have expansion racks in your original configuration copy them into the SIM_IO configuration 10 If you have PROFIBUS slaves in your original configuration copy them into the SIM_IO configuration 11 Carefully check the addresses assigned by STEP 7 to the modules in the SIM_IO configuration and make any necessary changes 12 Save the SIM_IO configuration and download the configuration to the S7 PLCSIM 13 Close the original configuration Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 C 3 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Index Accessible nodes location of button 4 2 viewing the simulated PLCs Accessing the CPU memory areas 5 4 Accumulators 5 8 B 2 Address registers AR1 and AR2 5 8 B 2 Addresses symbolic or absolute Assistance technical Authorization original disk 2 2 transfer 2 3 AUTHORS EXE 2 3 BCD binary coded decimal format B 4 Binary data format B 4 Bit memory area of memory description B 2 Blocks FBs FCs DBs OBs 1 3 C Changing the CPU operating mode 5 3 Changing the node address turning the power off Closing the simulated PLC 4 7 Continuous scan 4 3 Controlling the execution of a program simulator options 4 3 Copy protection 2 2 Counters accessing counter data 5 4 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 CPU areas
53. tack which consists of the RLO bit and the OR bit of the status word The nesting stack shows the state of the status word for each instruction in the logic string This view object also shows the state of the MCR master control relay stack There is no restriction on the number of view objects that you can create and display For more information on using view objects see Chapter 5 Using the STEP 7 Tools You can use the STEP 7 tools to monitor and modify the program that is being executed by the simulated CPU This allows you to create and test a variable table VAT or to use the debugging tools provided by STEP 7 For more information about the STEP 7 tools see the STEP 7 User Manual or the manual for your programming language S7 PLCSIM requires you to disconnect any STEP 7 tool before closing the simulated CPU or exiting the S7 PLCSIM application Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 Running a Program on the Simulated PLC Note Using the Pause function can cause the STEP 7 tools to disconnect from the simulated PLC because of a time out while STEP 7 waits for a request to be acknowledged After you turn Pause off you can reconnect the STEP 7 tool Using a Variable Table to Monitor or Modify Data You can use a variable table VAT to monitor the status of any variable in your program You can also modify the variables which are defined for the VAT You can use the simulated CPU to test a V
54. ternal inputs and outputs Peripheral output VO Peripheral memory can be accessed in byte word and PQ external outputs double word format but not as bits Timer T Timer This area provides storage for timer values Counter C Counter This area provides storage for counter values Data block DB Part of the DBs store the information for the program program Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 B 3 S7 Reference Information B 2 B 4 S7 PLCSIM Notation for Entering Data The Variables view object provides a variety of formats for displaying or entering the data in your program The formats allowed are determined by the size entered with the address byte B word W or double word D Table B 2 lists the formats that are available Table B 2 Data Formats for the Variables View Object DataFormat O Size Example Bis BB l off M on BCD binary coded decimal W and D 400 Binary B and W 10010011 Char character B W and D a s7 Date w 1998 06 18 Decimal B W and D 232 Hex hexadecimal B W and D 9A Integer W and D 623 2370 Real D 2134 232323 S5Time Ww 3m25s30ms S7 Format B W and D DW 16 09A2FF23 Slider Dec decimal B W and D Slider Int integer WandD Slider Real D I Time D 2d8h15m6s24
55. that the CPU is in STOP mode As with a real CPU you can download the hardware configuration only when the simulated CPU is in STOP mode Note If the CPU view object is in RUN P mode S7 PLCSIM prompts you to change to STOP mode before downloading the hardware configuration Verify that the CPU and the program use the same node address As with a real MPI network the node address defined for the program must match the node address of the CPU When you attempt to close the simulated PLC a message alerts you that there is a connection open If you attempt to close the simulated PLC while one of the STEP 7 tools such as a variable table is monitoring the program STEP 7 alerts you to disconnect the STEP 7 tool from the simulated PLC Always disconnect any STEP 7 tool by turning off the monitoring of the program status or by closing the tool before closing the simulated PLC The S7 PLCSIM application does not respond and appears to have locked up First check to see if Single Scan execution control or the Pause function is on Either one can appear as a lock up Turn off Pause or select Continuous Scan mode If the software does not respond to one of the actions above press the Ctrl Alt Del keys simultaneously and end the S7 PLCSIM application Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02 A 1 Testing Your S7 Progams with S7 PLCSIM C79000 G7076 C201 02
56. ts of this manual for agreement with the hardware and software described Since deviations cannot be precluded entirely we cannot guarantee full agreement However the data in this manual are reviewed regularly and any necessary corrections included in subsequent editions Suggestions for improvement are welcomed Siemens AG 1998 Technical data subject to change Siemens Aktiengesellschaft C79000 G7076 C201 Preface Audience S7 PLCSIM is an optional software product for STEP 7 The S7 PLCSIM software enables you to run and test your program on a simulated programmable logic controller PLC that exists on your computer or programming device such as a PG 740 Because the simulation exists completely within the STEP 7 software you do not need to be connected to any S7 hardware CPU or I O modules With the simulated S7 CPU you can test and debug programs for both the S7 300 and S7 400 CPUs S7 PLCSIM provides a simple interface for monitoring and modifying different parameters used by the program such as for turning inputs on and off You can also use the various applications of the STEP 7 software while you are running your program on the simulated CPU This allows you to use such tools as the variable table VAT to monitor and modify variables The Readme file for S7 PLCSIM provides information about the system requirements and the versions of STEP 7 that support S7 PLCSIM version 4 This manual is intended for engine
Download Pdf Manuals
Related Search
Related Contents
Guía Rápida Motorola RAZR2 V8 Epoch User Guide User`s manual - VTech Communications Sony VAIO VPCEE25FX/BI notebook User Guide MANUAL DE CODIFICAÇÃO 22 操作方法(取扱説明書より抜粋)pdf Copyright © All rights reserved.
Failed to retrieve file