Summary of Contents for SIMATIC STEP 7 V5.2

Page 1: ...iguring the Central Rack 6 Downloading and Debugging the Program 7 Programming a Function 8 Programming a Shared Data Block 9 Programming a Multiple Instance 10 Configuring the Distributed I O 11 Appendix Appendix A A Index SIMATIC Working with STEP 7 V5 2 Getting Started This manual is part of the documentation package with the order number 6ES7810 4CA06 8BA0 Edition 12 2002 A5E00171228 01 ...

Page 2: ...r precautions are not taken Warning indicates that death severe personal injury or substantial property damage can result if proper precautions are not taken Caution indicates that minor personal injury can result if proper precautions are not taken Caution indicates that property damage can result if proper precautions are not taken Notice draws your attention to particularly important informatio...

Page 3: ...uld be useful and you should preferably be familiar with the basic principles of programmable logic control The STEP 7 training courses provide you with in depth knowledge above and beyond the contents of this Getting Started manual teaching you how entire automation solutions can be created with STEP 7 Requirements for Working with the Getting Started Manual In order to carry out the practical ex...

Page 4: ...Welcome to STEP 7 STEP 7 Getting Started iv A5E00171228 01 ...

Page 5: ... 2 4 3 4 4 Opening the LAD STL FBD Program Window Programming OB1 in Ladder Logic Programming OB1 in Statement List Programming OB1 in Function Block Diagram 4 1 4 4 4 8 4 11 5 Creating a Program with Function Blocks and Data Blocks 5 1 5 2 5 3 5 4 5 5 5 6 5 7 5 8 Creating and Opening Function Blocks FB Programming FB1 in Ladder Logic Programming FB1 in Statement List Programming FB1 in Function B...

Page 6: ...mming Functions Calling the Function in OB1 8 1 8 3 8 6 9 Programming a Shared Data Block 9 1 Creating and Opening Shared Data Blocks 9 1 10 Programming a Multiple Instance 10 1 10 2 10 3 10 4 Creating and Opening a Higher Level Function Block Programming FB10 Generating DB10 and Adapting the Actual Value Calling FB10 in OB1 10 1 10 3 10 7 10 9 11 Configuring the Distributed I O 11 1 Configuring t...

Page 7: ...ogic Using the programmed logic operations you will address the inputs and outputs of your CPU if present The programming examples in the Getting Started manual are based among other things on three fundamental binary logic operations The first binary logic operation which you will program later on is the AND function The AND function can be best illustrated in a circuit diagram using two keys The...

Page 8: ...he third binary logic operation is the memory element The SR function reacts within a circuit diagram to certain voltage states and passes these on accordingly Memory Element S R Key S Key R If key S is pressed the bulb lights up and remains lit until key R is pressed ...

Page 9: ...oller consists of a power supply unit a CPU and input and output modules I O modules The programmable logic controller PLC monitors and controls your machine with the S7 program The I O modules are addressed in the S7 program via the addresses Transferring a program STEP 7 software Machine to be controlled Input module CPU Power supply module Output module Programming device cable Programming devi...

Page 10: ...lected components and you cannot call these addresses via STEP 7 In the hardware configuration not only can you define addresses but you can also change the parameters and properties of modules If you want to operate several CPUs for example you have to match up the MPI addresses of the CPUs Since we are only using a small number of inputs and outputs in the Getting Started manual we will skip the...

Page 11: ... Drive STEP 7 Disk1 If you need to install STEP 7 first insert the STEP 7 CD in the CD ROM drive now The installation program starts automatically Follow the instructions on the screen Once the installation is complete and you have restarted the computer the SIMATIC Manager icon will appear on your Windows desktop If you double click the SIMATIC Manager icon following installation the STEP 7 Wizar...

Page 12: ...Introduction to STEP 7 1 6 STEP 7 Getting Started A5E00171228 01 ...

Page 13: ...ams in order Double click the SIMATIC Manager icon on the Windows desktop then select the File Wizard New Project menu command if the wizard does not start automatically In the preview you can toggle the view of the project structure being created on and off To move to the next dialog box click Next Within the project data are stored in the form of objects in a hierarchical structure The SIMATIC s...

Page 14: ... already selected Select one of the programming languages Ladder Logic LAD Statement List STL or Function Block Diagram FBD Confirm your settings with Next Every CPU has certain properties for example regarding its memory configuration or address areas This is why you have to select the CPU before you start programming The MPI address multipoint interface is required in order for your CPU to commu...

Page 15: ...tting Started project you have created On the following pages we will show you what the created files and folders are for and how you can work effectively with them The STEP 7 Wizard is activated each time the program is started You can deactivate this default setting in the first dialog box for the Wizard However if you create projects without the STEP 7 Wizard you must create each directory with...

Page 16: ...all the STEP 7 functions and windows Downloading the program and monitoring the hardware Opening organizing and printing projects Calling the STEP 7 online help Setting the window display and arrangement selecting the language and making settings for process data Editing blocks and inserting program components The contents of the right hand pane show the objects and other folders for the folder se...

Page 17: ...king the sign in the Contents list At the same time the contents of the selected topic are displayed in the right hand pane Using Index and Find you can enter search strings and look for the specific topics you require Option 3 Click on the Start page icon in the STEP 7 Online Help to open the information portal This portal provides compact access to major topics of the Online Help e g Getting Sta...

Page 18: ...s From here you will start programming in Ladder Logic Statement List or Function Block Diagram in Chapters 4 and 5 Click the SIMATIC 300 Station folder All the hardware related project data are stored here You will use the Hardware component in Chapter 6 to specify the parameters of your programmable controller If you require further SIMATIC software for your automation task for example the optio...

Page 19: ...u choose SF BATF DC 5V FRCE RUN RUN P RUN STOP M RES STOP ON OFF 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 L L M M M N L L M Digital input module Byte 1 Bits 0 to 7 Digital input module Byte 0 Bits 0 to 7 Digital output module Byte 4 Bits 0 to 7 Digital output module Byte 5 Bits 0 to 7 Bit 5 Absolute address I 1 5 Byte 1 You should only use abs...

Page 20: ...Navigate in the project window Getting Started until you reach S7 Program 1 and double click to open the Symbols component Your symbol table currently only consists of the predefined organization block OB1 Click Cycle Execution and overwrite it with Main Program for our example Enter Green Light and Q 4 0 in row 2 The data type is added automatically Click in the comment column of row 1 or 2 to en...

Page 21: ...f this type occupy exactly one character of the ASCII character set INT DINT REAL They are available for the processing of numerical values for example to calculate arithmetic expressions S5TIME TIME DATE TIME_OF_DAY Data of this type represent the different time and date values within STEP 7 for example to set the date or to enter the time value for a timer Here you can see the symbol table for t...

Page 22: ...Programming with Symbols 3 4 STEP 7 Getting Started A5E00171228 01 ...

Page 23: ...d for this chapter too you must decide which language to use Ladder Logic LAD Suitable for users from the electrical engineering industry for example Statement List STL Suitable for users from the world of computer technology for example Function Block Diagram FBD Suitable for users from the world of circuit engineering for example The block OB1 will now be opened according to the language you cho...

Page 24: ...g Started Then close the window ZEn01_XXX Double click OB1 in the Getting Started project The LAD STL FBD program window is opened In STEP 7 OB1 is processed cyclically by the CPU The CPU reads line by line and executes the program commands When the CPU returns to the first program line it has completed exactly one cycle The time required for this is known as the scan cycle time Depending on which...

Page 25: ...ling Program elements and Call structure on and off Pane can be placed anywhere in the program window Inserting a new network Changing the programming language view The most important program elements for Ladder Logic and Function Block Diagram The variable declaration table contains the parameters and local variables for the block Information on the selected program element The different tabs of ...

Page 26: ...as the programming language in the View menu Click in the title area of OB1 and enter Cyclically processed main program for example Select the current path for your first element Click the button in the toolbar and insert a normally open contact In the same way insert a second normally open contact Insert a coil at the right hand end of the current path The addresses of the normally open contacts ...

Page 27: ...rom the displayed pull down list Confirm with Enter Enter the symbolic name Key_2 for the second normally open contact Enter the name Green_Light for the coil You have now programmed a complete series circuit Save the block if there are no more symbols shown in red Symbols are indicated in red if for example they do not exist in the symbol table or if there is a syntax error ...

Page 28: ... the vertical line of the current path Insert a parallel branch Add another normally open contact in the parallel branch Close the branch if necessary select the lower arrow The addresses are still missing in the parallel circuit To assign symbolic addresses proceed in the same way as for the series circuit Overwrite the upper normally open contact with Key_3 the lower contact with Key_4 and the c...

Page 29: ...ct Manual_On SR element Automatic_Mode Save the block and close the window If you want to see the difference between absolute and symbolic addressing deactivate the menu command View Display Symbolic Representation You can change the line break for symbolic addressing in the LAD STL FBD program window by using the menu command Options Customize and then selecting Width of address field in the LAD ...

Page 30: ...amming an AND Instruction in Statement List If necessary set STL as the programming language in the View menu Check whether symbolic representation is activated Click in the title area of OB1 and enter Cyclically processed main program for example Select the area for your first statement Type an A AND in the first program line a space and then the symbolic name Key_1 in quotation marks Complete th...

Page 31: ...nd select the input area again Enter an O OR and the symbolic name Key_3 in the same way as for the AND instruction Complete the OR instruction and save it Symbols are indicated in red if for example they do not exist in the symbol table or if there is a syntax error You can also insert the symbolic name directly from the symbol table Click the sign and then the menu command Insert Symbol Scroll t...

Page 32: ...ic name Automatic_On Complete the memory instruction and save it Close the block If you want to see the difference between absolute and symbolic addressing deactivate the menu command View Display Symbolic Representation Example Symbolic addressing in STL Example Absolute addressing in STL You can find more information under Help Contents in the topics Programming Blocks Creating Logic Blocks and ...

Page 33: ...am FBD Programming an AND Function in Function Block Diagram If necessary set FBD as the programming language in the View menu Click in the title area of OB1 and enter Cyclically processed main program for example Select the input area for the AND function below the comment field Insert an AND box and an assignment The addresses of the elements are still missing in the AND function Check whether s...

Page 34: ...name from the displayed pull down list Confirm with Enter Enter the symbolic name Key_2 for the second input Enter the name Green_Light for the assignment You have now programmed a complete AND function If there are no more symbols shown in red you can save the block Symbols are indicated in red if for example they do not exist in the symbol table or if there is a syntax error ...

Page 35: ...iagram Insert a new network Select the input area again for the OR function Insert an OR box 1 and an assignment The addresses are still missing in the OR function Proceed in the same way as for the AND function Enter Key_3 for the upper input Key_4 for the lower input and Red_Light for the assignment Save the block ...

Page 36: ...ry bit Automatic_Mode Save the block and close the window If you want to see the difference between absolute and symbolic addressing deactivate the menu command View Display Symbolic Representation You can change the line break for symbolic addressing in the LAD STL FBD program window by using the menu command Options Customize and then selecting Address Field Width in the LAD FBD tab Here you can...

Page 37: ...1 symbolic name Engine see symbol table page 3 3 in the LAD STL FBD program window which you are now familiar with To do this you should use the same programming language as in Chapter 4 programming OB1 You should have already copied the symbol table into your project Getting Started If not read how to do this on page 4 2 copying the symbol table and then return to this section If necessary open t...

Page 38: ...ck activate the check box Multiple instance FB and confirm the remaining settings with OK The function block FB1 has been inserted in the Blocks folder Depending on which programming language you have selected continue reading in either Section 5 2 for Ladder Logic Section 5 3 for Statement List or Section 5 4 for Function Block Diagram You can find more information under Help Contents in the topi...

Page 39: ... enter a series circuit a parallel circuit and a memory function with STEP 7 Declare Define Variables First Your LAD STL FBD program window is open and the option View LAD programming language is activated Note that FB1 is now in the header because you double clicked FB1 to open the program window The variable declaration area consists of a variable overview left pane and of the variable detail vi...

Page 40: ...catalog Then select the current path immediately before the input R Insert another normally open contact Select the current path immediately before this contact Insert a normally closed contact parallel to the normally open contact Only letters numbers and the underscore are permitted characters for the names of the block parameters in the variable declaration table If all the columns required are...

Page 41: ...s assigned automatically Enter the symbolic name Automatic_Mode for the normally closed contact in the series circuit Then save your program Local block variables are indicated with a sign and are only valid in the block Global variables appear in quotation marks These are defined in the symbol table and are valid for the entire program The signal state Automatic_Mode is defined in OB1 Network 3 s...

Page 42: ...tic_Mode has signal state 0 the engine is switched on This function is not enabled until Automatic_Mode is negated normally closed contact When the variable Switch_Off has signal state 1 or the variable Fault has signal state 0 the engine is switched off This function is achieved again by negating Fault Fault is a zero active signal and has the signal 1 in the normal state and 0 if a fault occurs ...

Page 43: ...n AND instruction an OR instruction and the set reset memory instructions with STEP 7 Declare Define Variable First Your LAD STL FBD program window is open and the option View STL programming language is activated Note that FB1 is now in the header because you double clicked FB1 to open the program window The variable declaration area consists of a variable overview left pane and of the variable d...

Page 44: ... block variables are indicated with a sign and are only valid in the block Global variables appear in quotation marks These are defined in the symbol table and are valid for the entire program The signal state Automatic_Mode is defined in OB1 Network 3 see page 4 10 by another SR element and now queried in FB1 Only letters numbers and the underscore are permitted characters for the names of the bl...

Page 45: ...closed contact When the variable Switch_Off has signal state 1 or the variable Fault has signal state 0 the engine is switched off This function is achieved again by negating Fault Fault is a zero active signal and has the signal 1 in the normal state and 0 if a fault occurs How does the comparator monitor the engine speed The comparator compares the variables Actual_Speed and Setpoint_Speed and a...

Page 46: ...ow how to enter an AND function an OR function and a memory function with STEP 7 Declare Define Variables First Your LAD STL FBD program window is open and the option View FBD programming language is activated Note that FB1 is now in the header because you double clicked FB1 to open the program window The variable declaration area consists of a variable overview left pane and the variable detail v...

Page 47: ...etwork 1 using the Program Elements catalog Bit Logic folder Add an AND box at input S Set and an OR box at input R Reset Check whether symbolic representation is activated Local block variables are indicated with a sign and are only valid in the block Global variables appear in quotation marks These are defined in the symbol table and are valid for the entire program ...

Page 48: ... with the symbolic name Automatic_Mode Negate the inputs Automatic_Mode and Fault with the corresponding button from the toolbar Then save your program Local block variables are indicated with a sign and are only valid in the block Global variables appear in quotation marks These are defined in the symbol table and are valid for the entire program The signal state Automatic_Mode is defined in OB1 ...

Page 49: ...tate 0 the engine is switched on This function is not enabled until Automatic_Mode is negated normally closed contact When the variable Switch_Off has signal state 1 or the variable Fault has signal state 0 the engine is switched off This function is achieved again by negating Fault Fault is a zero active signal and has the signal 1 in the normal state and 0 if a fault occurs How does the comparat...

Page 50: ... setpoint speeds of the engines are stored in two separate data blocks in which the actual value Setpoint_Speed is changed By centrally programming the function block only once you can cut down on the amount of programming involved The Getting Started project is open in the SIMATIC Manager Navigate to the Blocks folder and click in the right half of the window with the right mouse button Insert a ...

Page 51: ...r the actual value 1200 for the diesel engine Save DB2 and close the program window By changing the actual values you have finished your preparations for controlling two engines with just one function block To control more engines all you have to do is generate additional data blocks The next thing you have to do is program the call for the function block in OB1 To do this continue reading in Sect...

Page 52: ...ct Navigate to the Blocks folder and open OB1 Select network 3 and then insert network 4 in the LAD STL FBD program window In the program elements catalog navigate to FB1 and insert it via a double click Insert a normally open contact in front of each of the following Switch_On Switch_Off and Fault Click the sign above Engine and then keeping the cursor in the same position click in the input fram...

Page 53: ...input frame in quotation marks Click the question marks and after entering a quotation mark address all the other parameters of the function block using the corresponding symbolic names in the pull down list The engine specific input and output variables declaration in and out are displayed in the FB Engine A signal PE_xxx is assigned to each of the variables for the petrol engine ...

Page 54: ...on blocks and data blocks you must program the call for subordinate blocks such as FB1 in the block above them in the hierarchy for example OB1 The procedure is always the same You can also give the various blocks symbolic names in the symbol table for example FB1 has the name Engine and DB1 the name Petrol You can archive or print out the programmed blocks at any time The corresponding functions ...

Page 55: ...Manager is open with your Getting Started project Navigate to the Blocks folder and open OB1 Select network 3 and then insert network 4 in the LAD STL FBD program window Type CALL Engine Petrol in the code section and then press Enter All the parameters of the function block Petrol are displayed Position the cursor after the equals sign of Switch_On and press the right mouse button Click on Insert...

Page 56: ...ariables for the petrol engine When you create program structures with organization blocks function blocks and data blocks you must program the call for subordinate blocks such as FB1 in the block above them in the hierarchy for example OB1 The procedure is always the same You can also give the various blocks symbolic names in the symbol table for example FB1 has the name Engine and DB1 the name P...

Page 57: ...ing Started project Navigate to the Blocks folder and open OB1 Select network 3 and then insert network 4 in the LAD STL FBD program window Then navigate in the Program Elements catalog until you reach FB1 and insert this block All the engine specific input and output variables are displayed Click the sign above Engine and then keeping the cursor in the same position click in the input frame with ...

Page 58: ... the data block Petrol It is taken from the pull down list and entered automatically in the input frame in quotation marks Address all the other parameters of the function block using the corresponding symbolic names in the pull down list A signal PE_xxx is assigned to each of the variables for the petrol engine ...

Page 59: ...such as FB1 in the block above them in the hierarchy for example OB1 The procedure is always the same You can also give the various blocks symbolic names in the symbol table for example FB1 has the name Engine and DB1 the name Petrol You can archive or print out the programmed blocks at any time The corresponding functions can be found in the SIMATIC Manager under the menu commands File Archive or...

Page 60: ...Creating a Program with Function Blocks and Data Blocks 5 24 STEP 7 Getting Started A5E00171228 01 ...

Page 61: ...ation data are transferred to the programmable controller later on downloading see Chapter 7 The starting point is the open SIMATIC Manager together with the Getting Started project Open the SIMATIC 300 Station folder and double click the Hardware symbol The HW Config window opens The CPU you selected on creating the project is displayed For the Getting Started project this is CPU 314 Rack with in...

Page 62: ... the module However you should only change the parameters if you are sure you know what effects the changes will have on your programmable controller No changes are necessary for the Getting Started project The data are prepared for transfer to the CPU using the menu command Save and Compile Once you close the HW Config application the System Data symbol will appear in the Blocks folder You can al...

Page 63: ...it You should have Configured the hardware for the Getting Started project see Chapter 6 Set up the hardware according to the installation manual Example of a series circuit AND function Output Q 4 0 is not to light up diode Q 4 0 lights up on the digital output module unless both Key I 0 1 and Key I 0 2 are pressed Set up the test configuration below using wires and your CPU Operating mode keyswi...

Page 64: ... the key in the CPU once you have finished assembling all the modules You can still carry out the test even if you are using different hardware to that shown in the diagram You simply have to keep to the addressing of the inputs and outputs STEP 7 offers you various ways of debugging your program for example using the program status or by means of the variable table You can find more information o...

Page 65: ...e red STOP LED will light up Resetting the CPU and Switching it to RUN Turn the operating mode switch to the MRES position and hold it there for at least 3 seconds until the red STOP LED starts flashing slowly Release the switch and after a maximum of 3 seconds turn it to the MRES position again When the STOP LED flashes quickly the CPU has been reset If the STOP LED does not start flashing quickl...

Page 66: ...rogramming device the online window shows the situation on the CPU Select the Blocks folder in the offline window and then download the program to the CPU using the menu command PLC Download Confirm the prompt with OK The program blocks are displayed in the online window when you download them The system functions SFCs remain in the CPU even though you have carried out a memory reset The CPU provi...

Page 67: ... RUN P mode are activated immediately You should therefore remember the following If error free blocks are overwritten with faulty blocks this will lead to a plant failure You can avoid this by testing your blocks before you download them If you do not observe the order in which blocks are to be downloaded first the subordinate blocks and then the higher level blocks the CPU will go into STOP mode...

Page 68: ... function Debug Monitor Debugging with Ladder Logic The series circuit in Network 1 is displayed in Ladder Logic The current path is represented as a full line up to Key 1 I 0 1 this means that power is already being applied to the circuit Debugging with Function Block Diagram The signal state is indicated by 0 and 1 The dotted line means that there is no result of logic operation Debugging with S...

Page 69: ...fulfilled up to this point With the Statement List programming language the display in the STA and RLO columns changes when the result of logic operation is fulfilled Deactivate the function Debug Monitor and close the window Then close the online window in the SIMATIC Manager We recommend you do not completely download extensive programs onto the CPU to run them because diagnosing errors is more ...

Page 70: ...ou can also test the comparator for the engine speed in FB1 by presetting the actual speed Creating the Variable Table The starting point is the SIMATIC Manager again with the open project window Getting Started Offline Navigate to the Blocks folder and click in the right half of the window with the right mouse button Use the right mouse button to insert a Variable Table from the pop up menu Apply...

Page 71: ...entry with Enter Change the status format of all the speed values to DEC decimal format To do this click the corresponding cell and select DEC format using the right mouse button Save your variable table Switching the Variable Table Online Click the ON button in the toolbar of the Monitoring and Modifying Variables window to establish a connection to the configured CPU The word ONLINE will appear ...

Page 72: ...mode of the CPU is displayed in the status bar Press Key 1 and Key 2 in your test configuration and monitor the result in the variable table The status values in the variable table will change from false to true Modifying Variables Enter the value 1500 for the address MW2 in the Modify Value column and 1300 for the address MW4 Transfer the modify values to your CPU ...

Page 73: ...ables often cannot be displayed fully due to the limited screen space If you have large variable tables we recommend you create several tables for one S7 program using STEP 7 You can adapt the variable tables to precisely match your own test requirements You can assign individual names to variable tables in the same way as for blocks for example the name OB1_Network1 instead of VAT1 Use the symbol...

Page 74: ...P mode First turn the operating mode switch on the CPU to STOP The starting point is the SIMATIC Manager again with the open project window Getting Started Offline Select the Blocks folder If there are several CPUs in your project first determine which CPU has gone into STOP All the accessible CPUs are listed in the Diagnosing Hardware dialog box The CPU with the STOP operating mode is highlighted...

Page 75: ...PU to go into STOP mode select the event and click the Open Block button The block is then opened in the familiar LAD STL FBD program window and the faulty network is highlighted With this chapter you have successfully completed the Getting Started sample project from creating a project through to debugging the finished program In the next chapters you can extend your knowledge further by working ...

Page 76: ...Downloading and Debugging the Program 7 14 STEP 7 Getting Started A5E00171228 01 ...

Page 77: ...y as a function block using the LAD STL FBD program window You should already be familiar with programming in Ladder Logic Function Block Diagram or Statement List see Chapters 4 and 5 and also symbolic programming see Chapter 3 If you have worked through the Getting Started sample project in Chapters 1 to 7 open this now If not create a new project in the SIMATIC Manager using the menu command Fi...

Page 78: ... contrast to the function block no static data can be defined in the variable declaration table for a function The static data defined in a function block are retained when the block is closed Static data can be for example the memory bits used for the Speed limit values see Chapter 5 To program the function you can use the symbolic names from the symbol table You can find more information under H...

Page 79: ...nput and output parameters of the function in and out declaration in the variable detail view The LAD STL FBD program window is open You work with this variable detail view in the same way as with the detail view for the function block see Chapter 5 Enter the following declarations Programming the Timer Function in Ladder Logic Select the current path for entering the Ladder instruction Navigate i...

Page 80: ...he Timer Function in Statement List If you are programming in Statement List select the input area below the network and enter the statement as shown here Then save the function and close the window The Timer_Function is started with the input parameter Engine_On Later on when the function is called in OB1 it will be supplied once with the parameters for the petrol engine and once with the paramet...

Page 81: ...work and enter the FBD program below for the timer function Then save the function and close the window In order for the timer function to be processed you need to call the function in a block which is higher up in the block hierarchy in our example in OB1 You can find more information under Help Contents in the topics Calling Reference Helps The STL FBD or LAD Language Description and Timer Instr...

Page 82: ...project or your new project Navigate to the Blocks folder and open OB1 The LAD STL FBD program window opens Programming the Call in Ladder Logic You are in LAD view Select network No 5 and insert a new network No 6 Then navigate in the Program Elements catalog until you reach FC1 and insert the function Insert a normally open contact in front of Engine_On Click the question marks for the FC1 call ...

Page 83: ... addresses for the diesel engine to the symbol table Save the block and then close the window Activate the menu command View Display Symbol Information to view the information on individual addresses in each network To display several networks on the screen deactivate the menu command View Display Comment and if necessary View Display Symbol Information Using the menu command View Zoom Factor you ...

Page 84: ...he FBD instructions shown below Then save the call and close the window The call for the functions was programmed as an unconditional call in our example that is the function will always be processed Depending on the requirements of your automation task you can make the call for a function or function block dependent on certain conditions for example an input or a preceding logic operation The EN ...

Page 85: ...ou should already be familiar with programming in Ladder Logic Function Block Diagram or Statement List see Chapters 4 and 5 and also symbolic programming see Chapter 3 If you have worked through the Getting Started sample project in Chapters 1 to 7 open this now If not create a new project in the SIMATIC Manager using the menu command File New Project Wizard To do this follow the instructions in ...

Page 86: ... to select the type using the menu command Elementary Types INT from the pop up menu In the example below three shared data are defined in DB3 Enter these data accordingly in the variable declaration table Save the shared data block Remember In Section 5 5 you generated an instance data block by activating the option Data block referencing a function block In contrast using Data block you create a...

Page 87: ...e for the shared data block see Section 5 5 Shared data blocks in the symbol table In contrast to the instance data block the data type for the shared data block in the symbol table is always the absolute address In our example the data type is DB3 With the instance data block the corresponding function block is always specified as the data type You can find more information under Help Contents in...

Page 88: ...Programming a Shared Data Block 9 4 STEP 7 Getting Started A5E00171228 01 ...

Page 89: ...e rapeseed oil engine FB1 with DB4 for the hydrogen engine etc The number of blocks would increase significantly as you created new engine control programs By working with multiple instances on the other hand you can reduce the number of blocks To do this you create a new higher level function block in our example FB10 and call the unchanged FB1 in it as a local instance For each call the subordin...

Page 90: ...t half of the window and insert a function block using the pop up menu Change the name of the block to FB10 and select the required programming language Activate Multiple instance FB if necessary and accept the remaining default settings with OK FB10 has been added to the Blocks folder Double click to open FB10 You can create multiple instances for any function block even for valve control program...

Page 91: ...ine Variables FB10 is open in the LAD STL FBD program window Transfer the declarations of the subsequent image to your variable detail view To do this select the declaration types OUT STAT and TEMP one after the other and make your entries in the variable detail view Select FB nr as the data type for the declaration type STAT from the pull down list and replace the character string nr with the 1 T...

Page 92: ...required normally open contacts and complete the call with the symbolic names Insert a new network and program the call for the diesel engine Proceed in the same way as for Network 1 The Actual_Speed for the engines is not taken from a memory bit see Section 5 6 onwards but from a shared data block see Section 9 1 The general address assignment is as follows Data_Block Address for example S_Data P...

Page 93: ...variables in the pull down menu by the symbols displayed on the left Then save your program and close the block Programming FB10 in Statement List If you are programming in Statement List select the input area under a new network and enter the STL instructions shown here Then save your program and close the block The temporary variables PE_Setpoint_Reached and DE_Setpoint_Reached are supplied to t...

Page 94: ...nter the FBD instructions below Then save your program and close the block To edit both calls for FB1 in FB10 FB10 must be called itself Multiple instances can only be programmed for function blocks Creating multiple instances for functions FCs is not possible You can find more information under Help Contents in the topics Programming Blocks Creating Logic Blocks and Multiple Instances in the Vari...

Page 95: ...menu To do this change the name of the data block to DB10 in the dialog box Properties Data Block then select the application Instance DB in the adjacent pull down list In the right pull down list select the function block FB10 to be assigned and confirm the remaining settings with OK The data block DB10 has been added to the Getting Started project Double click on DB10 In the following dialog box...

Page 96: ...ou can see the variables for calling the function block Petrol_Engine and in the second half the variables for calling the function block Diesel_Engine see Section 5 5 The internal variables of FB1 retain their symbolic names for example Switch_On The name of the local instance is now placed in front of these names for example Petrol_Engine Switch_On You can find more information under Help Conten...

Page 97: ...programmed FB10 Defining Symbolic Names The LAD STL FBD program window is open Open the symbol table using the menu command Options Symbol Table and enter the symbolic names for the function block FB10 and the data block DB10 in the symbol table Then save the symbol table and close the window Programming the Call in Ladder Logic Insert a new network at the end of OB1 and add the call for FB10 Engi...

Page 98: ...Programming the Call in Statement List If you are programming in Statement List select the input area under the new network and enter the STL instructions below To do this use the FB Blocks FB10 Engines in the Program Elements catalog Delete the call for FB1 in OB1 Networks 4 and 5 from Section 5 6 onwards since we are now calling FB1 centrally via FB10 Then save your program and close the block T...

Page 99: ... close the block If you require additional engine control programs for your automation task for example for gas engines hydrogen engines etc you can program these as multiple instances in the same way and call them from FB10 To do this declare the additional engines as shown in the variable declaration table of FB10 Engines and program the call for FB1 in FB10 multiple instance in the Program Elem...

Page 100: ...Programming a Multiple Instance 10 12 STEP 7 Getting Started A5E00171228 01 ...

Page 101: ...controller the I O modules and the field devices using the PROFIBUS DP You can find out how to program a conventional configuration in Chapter 6 It makes no difference whether you create a central configuration or a distributed configuration You select the modules to be used from the hardware catalog arrange them in the rack and adapt their properties according to your requirements It would be an ...

Page 102: ...he corresponding dialog box CPU with PROFIBUS DP network Now proceed in the same way as for Section 2 1 and assign the project the name GS DP Getting Started Distributed I O If you want to create your own configuration at this point specify your CPU now Note that your CPU must support distributed I Os Inserting the PROFIBUS Network Select the folder GS DP Insert the PROFIBUS network using the righ...

Page 103: ...P already appears in the rack If necessary open the Hardware catalog using the menu command View Hardware Catalog or the corresponding button in the toolbar Drag and drop the power supply module PS307 2A into slot 1 In the same way insert the I O modules DI32xDC24V and DO32xDC24V 0 5A in slots 4 and 5 In addition to the CPU which supports the distributed I O you can also place other CPUs in the sa...

Page 104: ...tings with OK Navigate in the Hardware catalog until you reach the module B 16DI and insert this module in the master system drag the object to the master system until the cursor changes to a sign then drop the object You can change the node address of the module you have inserted in the Parameters tab of the Properties dialog box Confirm the suggested address 1 with OK You can now move any object...

Page 105: ...0M in the network The free slots for the ET200M are displayed in the lower configuration table Select slot 4 here The ET200M itself can have additional I O modules Select for example the module DI32xDC24V for slot 4 and double click this module to insert it In our example we are using the default node addresses However you can change these addresses at any time to meet your requirements You should...

Page 106: ...her nodes one after another and check the input and output addresses The Configuring Hardware application has adapted all the addresses so there are no double assignments Let us imagine that you want to change the address of the ET200M Select the ET200M and double click DO32xDC24V 0 4A slot 4 Now change the input addresses in the Addresses tab of the Properties dialog box from 6 to 12 Close the di...

Page 107: ...sing the menu commands Station Consistency Check Configuring Hardware window and Network Consistency Check Configuring Networks window you can check the configuration for errors before saving Any errors are displayed and STEP 7 will suggest possible solutions You can find more information under Help Contents in the topics Configuring the Hardware and Configuring the Distributed I O The menu comman...

Page 108: ...rted on your first project If while working on future projects you are looking for specific functions or have forgotten any of the operating instructions in STEP 7 you can use our comprehensive Help on STEP 7 If you want to extend your knowledge of STEP 7 there are a number of specialized training courses available Your local Siemens representative will be happy to help you We wish you lots of suc...

Page 109: ...nguage ZEn01_06_STEP7__LAD_1 10 The programmed Chapters 1 to 10 including the symbol table in the LAD programming language ZEn01_05_STEP7__LAD_1 9 The programmed Chapters 1 to 9 including the symbol table in the LAD programming language ZEn01_04_STEP7__FBD_1 10 The programmed Chapters 1 to 10 including the symbol table in the FBD programming language ZEn01_03_STEP7__FBD_1 9 The programmed Chapters...

Page 110: ...Appendix A STEP 7 Getting Started A 2 A5E00171228 01 ...

Page 111: ...rating instance data blocks 5 14 Data type 3 3 Debugging with function block diagram 7 6 Debugging with ladder logic 7 6 Debugging with statement list 7 6 Declaring variables FBD 5 10 LAD 5 3 STL 5 7 Diagnostic Buffer evaluating 7 12 Distributed I O configuring 11 1 Downloading the program to the programmable controller 7 3 DP Master system configuring 11 4 E Establishing an online connection 7 1 ...

Page 112: ...gram 8 5 Programming the timer function in ladder logic 8 3 Programming the timer function in statement list 8 4 Programming symbolic 3 2 Project structure in the SIMATIC Manager 2 4 Project structure navigating 2 6 Projects creating 2 1 R Resetting the CPU and switching it to RUN 7 3 S Shared data block programming 9 1 Shared data blocks in the symbol table 9 3 Shared data blocks in the variable ...

Reviews: