Home
From S5 to S7 - Oskon Otomasyon
Contents
1. BR LAD STL FBD Example 4 57 Program 1 Local Data1 File Edit Insert PLC Debug View Options X Window Help e gt 4 ee Com v INT Calculating measured value Compiler Report x LocalData1 FUNCTION MEASVALS TITLE NAME MEASURED VALUE VERSION 01 00 File Name VAR_INPUT INPUT VALUE UPPER LIMIT LOWER LIMIT No of Lines 43 No of Warnings 0 No of Errors 10 VAR_TEMP LOCAL END_VAR Error Error Error Lin Lin Lin Lin 150 Level 10 Level 1 Level 2 16 Level 2 Symbol MEASVALS not in symbol table 2 Type conflict for MEASVALS Error writing to comment block 2 Variable INPUT VALUE does not match Error either either either I does not match I does not match M M Syntax error in L le UPPER L e LOWER L Variabl Variabl 28 2 2 Level Leve Leve 2 14 15 26 27 Lin Lin Lin in in in Error Error Error Error Error in Error in Compiler in 2 Variable LOCAL does not match either 5 Level 2 Syntax error in lumn 1 Level 2 Variable RET VAL does not match either a decl 10 Errors 0 Warnings Line 29 Line 30 Line 33 Result 9 Level n n n m 26 lum m m m a decl m 00000000 0 Consistency Check and Compiling Source Files Figure 8 1 If there are errors and or warnings present in your convert
2. SIMATIC Manager zebra File Edit Insert PLC View Options Window Help cem sole a PSI liie wel zebra Standard Hierarchy Offline Project C SIEMENS STEP7 S7proj ze eg EGER i SIMATIC 400 Station 1 ll SIMATIC 400 Station oa MPI 1 Oo Press F1 for help Figure 3 1 SIMATIC Manager with an Open Project From S5 to S7 Converter Manual A5E00171227 01 3 3 Software 3 2 Structure of an S7 Project Projects contain all the data and programs for an automation solution Their purpose is to provide organized storage of data and programs created for such an application You will already be familiar with the term project from working with STEP 5 In STEP 5 a project contains all STEP 5 files created for one user program in a project file This project file contains information necessary for convenient editing and maintenance of a user program such as parameter settings as well as catalog and file names In STEP 7 a project contains all the programs and data necessary for an automation solution regardless of the number of CPUs involved and how they are networked Thus a project is not just limited to a user program used for a particular programmable module instead it contains several user programs used for many programmable modules which are all stored together under a common proj
3. ELM Gwes o Figure 6 6 Print Dialog Box Localizing Errors Printing Messages From S5 to S7 Converter Manual A5E00171227 01 Interpreting Messages The messages generated during conversion consist of error messages and warnings To analyze these messages proceed as follows 1 Display the file containing the error in the lower list box of the Messages window 2 The meaning of the messages can be found in the online help 3 Correct the error as suggested under Remedy Error messages are displayed if parts of the S5 program cannot be converted and are only included as comments in the 57 program The table below lists all the error messages their meaning and possible remedies Chapter 3 Software contains the rules for converting 55 programs to S7 Here Conversion 6 3 Analyzing Messages Error Messages References to Rules you can also find further references to possible error sources and assistance when subsequently editing the STL program Table 6 1 Error Messages Meaning and Remedy Error Message Source Meaning Remedy Absolute parameter does not Ist run Wrong address ID Check the instruction match address Bit access to T C is no longer 2nd run 55 program contains bit access to Check the STL program allowed please check timers and counters Block not available Istrun Called block FB FX missing or Check the program structure block is shown in the block list but
4. Index 3 Industrial Ethernet 2 10 2 18 interface in user program modules 2 11 Inputs analog digital Installation STEP 7 software Instruction convertible A 3 A 4 non convertible Instruction macro Instructions overview Integer math instructions Interface modules Interprocessor communication flags Interrupt 3 20 3 22 Interrupt commands IP modules ISO transport 2 18 ISO on TCP 2 18 J Jump instructions L LIR 4 3 Load instructions Load memory CPU S7 300 CPU 57 400 Local data CPU Macro creating Math functions 3 29 3 38 Memory 4 3 Module catalog Module information Module parameters comparison S5 S7 Modules overview MPI 2 3 2 10 2 18 Multicomputing interrupt Multipoint interface M From S5 to S7 Converter Manual A5E00171227 01 Station STEP 7 STEP 5 block 3 17 STEP 5 project STEP 7 installing starting STEP 7 project archiving components STL Stop instructions Subnet 2 10 Symbol local Symbol table creating 3 15 example 9 14 STEP 7 object System data block SDB 3 17 3 19 System function SFC 3 17 3 19 System function block SFB 3 17 3 19 System settings 5 3 26 T Time delay interrupt 3 Time of day interrupt Timer instructions Timers Tool hardware conversion Transfer instructions U User aut
5. 7 2 3 Distributed I O Devices eseseeee RII 2 4 Soul s reser 0 0 0 000220 cause 2 4 1 Interface to User Programs 2 5 Operator Interface gt 3 DON WANE set aa accru UNO 879 270 87b ddr odo dca 878 E EENE UD ADR URS E cs X DOR V 3 1 General Operating Principles 0 3 1 1 Installation Requirements 00002 eee 3 1 2 Installing STEP 7 Software 0 0 eens 3 1 3 Starting STEP 7 Software 3 2 Structure of an S7 Project 0 ccc eee ee eens 3 3 Editing Projects with the SIMATIC Manager 3 3 1 Creating Projects 223m tiber dem men Sein ladenih Borse Whee Regler eon a os 3 3 2 Ona PIOIBGIS ues ro EE VEN cance erste mima Ed EN ER S BE 3 4 Configuring Hardware with STEP 7 9 5 Configuring Connections in the Connection Table 3 6 Inserting and Editing a Program 5 3 6 1 Basic Procedure for Creating Software eee eee 3 6 2 Inserting Components for Creating Software in S7 and M7 Programs du see cc p RP N 3 7 1 0 97 78 bed bandon wees 3 7 2 Functions and Function Blocks 00 3 13 Dalta BIOCKS a eee we eae es 3 7 4 System BIOCKRS uode doa vom tiga ence eben Um D e Rom glo me oul emos 3 7 5 OrdaniZation BIOCKS vs 22 dmm E mer Ex RE RESERE ERES 3 7 6 Block Representation during Conversion From S5 to S7 Converter Manual A5E00171227 01 Vil Contents 3 8 SYSIEM CU
6. A5E00171227 01 Organization Blocks Organization blocks OBs form the interface between the operating system and the user program Different organization blocks carry out their own specific tasks You assemble the STL user program for your S7 CPU from the organization blocks OBs required for your automation solution Function S5 S7 Free cycle OBI OBI Time delay delayed OB6 OB20 to OB23 interrupt Time of day OB9 OBIO to OBI7 clock controlled interrupt Hardware interrupts OB2 to OB5 OB40 to OB47 Process interrupts OB2 to OB9 IB 0 Replaced by hardware interrupts Cyclic timed OB10 to OB18 OB30 to OB38 interrupts Multicomputing OB60 interrupt Manual complete cold OB21 S5 115U OB20 OB100 restart from S5 135U Manual warm restart OB21 from S5 135U 1 Automatic warm OB22 1 restart Error OB19 to OB35 OB121 OB122 OB80 to OB87 Processing in STOP OB39 Omitted mode Background processing OB90 From S5 to S7 Converter Manual A5E00171227 01 Comparison of the OBs in S5 and S7 Software 3 7 5 Distribution of Organization Blocks Table 3 3 Main program Interrupts Startup Errors Other 3 20 Software Error Handling Error OBs Error OBs are called if an error occurs during program execution You can use them to help program error reactions If no error OB exists for a particular error type then the CPU goes into
7. ASCII CP 340 20 mA 3964 R ASCII CP 340 RS 422 485 3964 R ASCII Hardware Point To Point Connection S5 Module CP 521 3964 R ASCII CP 523 3964 R ASCII CP 544 3964 R RK 512 ASCID CP 524 525 3964 R RK 512 ASCII additional special drivers which can be loaded CP 544 B 3964 R RK 512 ASCII additional special drivers which can be loaded 2 12 Hardware Function Modules FM Some IP and WF modules in SIMATIC S5 can be used in S7 400 with the help of a special adapter casing In other cases there are new function modules available in S7 to help you obtain the functionality desired The following table provides an overview and comparison of the signal preprocessing modules available in S5 and 7 Comparison of Signal Preprocessing Modules in S5 and S7 Description Counter position detection and positioning modules Digital position detection module Counter module Counter module Controller module Positioning module for variable speed drives Positioning module for stepper motors Closed loop control module Closed loop control module Proportioning module Counter module Positioning module for regulating rapid creep feed and cam control Position detection module Positioning and counter module Cam control Positioning module 2 13 S7 Module FM 451 limited FM 451 FM 452 limited no no FM 455 FM 354 FM 357 FM 453
8. FM 353 FM 357 FM 453 FM 455 limited FM 355 limited no FM 350 1 FM 450 1 FM 451 FM 452 FM 451 limited FM 451 limited FM 452 limited FM 354 limited because of assembly technology Adapter Casing yes no no yes yes yes yes no no no no no yes no no yes 2 2 5 Table 2 3 S5 Module IP 240 IP 241 IP 242A IP 242B IP 244 IP 246I A IP 247 IP 252 IP 260 IP 261 IP 281 IP 288 WF 705 WF 706 WF 707 WF 721 From S5 to S7 Converter Manual A5E00171227 01 Comparison of Signal Preprocessing Modules in 55 and S7 continued Description Positioning module Positioning module Positioning module Application module M7 FM Numeric control Stepper motor control Stepper motor From S5 to S7 Converter Manual A5E00171227 01 S7 Module FM 453 FM 357 limited because of assembly technology no FM 456 4 SINUMERIK FM NC FM STEPDRIVE SIMOSTEP Adapter Casing yes yes yes Hardware Table 2 3 S5 Module WE 723A WE 723 B WF 723 C 2 14 Hardware 2 2 6 Signal Modules SM The signal modules in SIMATIC S7 are comparable in function to the input output modules in S5 However in addition to simple signal modules S7 also provides modules that can be assigned parameters
9. StdLib30 standard library under the heading StdOBs Based on diagnostic interrupt parameters previously configured in HW Config the digital modules make a request to the CPU for a diagnostic interrupt This function applies to both incoming and outgoing events After this request the operating system calls the organization block OB82 You can disable delay or re enable the calling of the diagnostic interrupt OB with the help of the system functions SFCs 39 to 42 For further information see the Reference Manual 235 The following sample program shows how the external auxiliary voltage is evaluated If the external auxiliary voltage is interrupted the bit NO EXT VOLTAGE is set in DB82 DB_DIAG In addition the module address and the time of the event are also saved This information can be processed later in the program Before the STL source file is compiled the symbol for the data block DB82 DB DIAG must be entered in the symbol table From S5 to S7 Converter Manual A5E00171227 01 OB82 Startup Information Start Information for OB82 Example 9 8 Application Example Module address No error bit for ext aux voltage Date and time at which the diagnostic interrupt was triggered Return code of SFC BLKMOV Event class and IDs B 16438 outgoing event B 16439 incoming event Error code B 16 42 Priority class 26 or 28 OB number Reserved Input module B 16 54 Ou
10. The macros are saved for the SIMATIC instruction set in the S7SSCAPA MAC file and for the international instruction set in the S7SSCAPB MAC file If you work with both instruction sets you must specify the macros for each file A distinction is made between instruction macros and OB macros You can create 256 instruction macros and 256 OB macros 5 4 Uses of Macros Macro Functions From 55 to S7 Converter Manual A5E00171227 01 Preparing for Conversion 5 4 1 Instruction Macros Instruction macros must be structured as follows SMACROS lt S5 Instructions S7 instruction sequence SENDMACRO When defining a macro enter the complete statement instruction and absolute address for S5 instruction The table below shows a macro for the statement G DB 0 which is used to set up data blocks in S5 The length in words of the data block to be set up is in ACCU 1 In 57 the function is realized using the system function SFC22 CREAT DB The length of the data block must be converted into bytes From S5 to S7 Converter Manual A5E00171227 01 Table 5 1 Example of an Instruction Macro Macro S5 S7 SMACRO 6 DB 0 Replaces instruction L Constant L Constant LOR Setting up a DB DO FW 100 SLW 1 Number of words G DB 0 Siw 1 into number of bytes T MW 102 af MW 102 CALL SFC22 CALL SFC 22 Call SFC CREAT DB LOW LIMIT MW 100 LOW_LIMIT Mw 100 UP_LIMIT MW 100 UP LIMIT MW 100 COUNT MW 10
11. When assigning parameters to the CPU in HWConfig you can also make system settings which were created in DB1 DXO in S5 or by system utilities see Section 3 4 The retentive behavior can also be set in the parameter data in the CPU The retentive behavior is however dependent on the battery backup see Section 3 4 From S5 to S7 Converter Manual A5E00171227 01 Defining Hardware Address Allocation Making System Settings Specifying Retentive Behavior 4 4 Preparing for Conversion Overview Providing the required files see Section 5 1 Program file lt Name gt ST S5D Cross reference list lt Name gt XR INI Optional assignment list lt Name gt Z0 SEQ Checking addresses Number of addresses see Section 5 2 Number of blocks Preparing the S5 program Evaluate and delete the see Section 5 3 data blocks DB1 0 Remove calls from the integrated blocks Remove access to the system data area Adapt the address areas Assign macros to non convertible program parts Delete data blocks without structure down to one data word Creating macros e Command macros see Section 5 4 Organization block OB macros From S5 to S7 Converter Manual A5E00171227 01 5 1 Preparing for Conversion 5 1 Providing the Required Files The following data are required as the basis for converting your S5 program e Program file Name ST S5D and e Cross reference list Name XR INI The cross reference list 18 required w
12. FIFO FC92 REG_FIFO 3 9 5 Analog Functions STEP 5 STEP 7 FB Name Number Name AE 460 FC100 AE 460 1 AE 460 FC101 AE 460 2 AE 463 FC102 AE 463 1 AE 463 FC103 AE 463 2 AE 464 FC104 AE 464 1 AE 464 FC105 AE 464 2 3 9 6 Math Functions STEP 5 STEP 7 FB Name Number Name SINE FC112 SINE COSINE FC113 COSINE TANGENT FC114 TANGENT COTANG FC115 COTANG ARCSIN FC116 ARCSIN ARCCOS FC117 ARCCOS ARCTAN FC118 ARCTAN From 55 to S7 Converter Manual A5E00171227 01 Software 3 10 Data Types STEP 7 uses new data formats The table below compares the different data types in S5 and S7 Table 3 9 Data Types in S5 and 7 Data Types in S5 Data Types in S7 Data Class BOOL BOOL Elementary data types BYTE BYTE WORD WORD DWORD DWORD Integer INT Double integer DINT Floating point REAL Time value SSTIME TIME DATE TIME_OF_DAY ASCII character CHAR DATE_AND_TIME Complex data types STRING ARRAY STRUCT Timers TIMER Parameter types Counters COUNTER Blocks BLOCK_FC BLOCK_FB BLOCK_DB BLOCK_SDB 0 POINTER 0 ANY From S5 to S7 Converter Manual A5E00171227 01 3 30 Software Table 3 10 Different Formats for Constants in S5 and S7 Bias This is an offset factor separating the exponents into positive and negative areas The value 127 in the exponent area corresponds to the value 0
13. ISO transport FDL SDA GD ISO on TCP FMS DP Subnets Industrial PROFIBUS MPI Ethernet The following is a summary of the communication services used in SIMATIC The S7 functions provide services for communicating between S7 M7 CPUs S7 OP OSs and PCs These S7 functions are already integrated in each SIMATIC S7 M7 device Since these S7 functions correspond to a service in the ISO application layer they are independent of any one subnet and can thus be used on all subnets MPI PROFIBUS Industrial Ethernet These functions are used for secure data transfer from SIMATIC S7 to SIMATIC S5 They are used to transfer moderate amounts of data up to 240 bytes via open communication at ISO transport layer 4 based on the ISO reference model for Industrial Ethernet These functions are used for secure data transfer from SIMATIC S7 to SIMATIC S5 They are used to transfer moderate amounts of data up to 240 bytes via open communication according to the TCP IP protocol at ISO transport layer 4 based on the ISO reference model for Industrial Ethernet The ISO on TCP service requires the extended RFC1006 standard These functions are used for secure data transfer from SIMATIC S7 to SIMATIC S5 They are used to transfer moderate amounts of data up to 240 bytes via open communication at Fieldbus Data Link FDL layer 2 based on the ISO reference model for Industrial Ethernet From S5 to S7 Converter Manual A5E00171227 01
14. Information about Location of error code omitted Omitted Set in HWConfig using CPU properties Set in HWConfig using CPU properties Set in HWConfig using CPU properties Set in HWConfig using CPU properties Call SFC27 UPDAT PO Call SFC26 UPDAT PI Set in HWConfig using CPU properties Set in HWConfig using CPU properties Set in HWConfig using CPU properties Replaced by MPI bus global data communication Set with HWConfig In preparation Set in HWConfig using CPU properties or by calling SFC28 SET TINT Set in HWConfig using CPU properties Set in HWConfig using CPU properties From S5 to S7 Converter Manual A5E00171227 01 Location of error code Replace number of integrated FBs On board analog inputs On board interrupt On board counter Change priorities of OBs Output disable process image Read in disable process image Retentive flags Retentive timers Retentive counters SINEC L1 SINEC L2 Software protection Clock parameters Assigning parameters to timed interrupt OBs Cycle time monitoring 3 26 Software How Implemented in S7 Call OB121 Global data communication Set in HWConfig using CPU properties Set in HWConfig using CPU properties Fixed CPU specific value for 7 300 or set in HWConfig using CPU properties for S7 400 Call SFC36 MSK FIT SFC37 DMSK FLT Present Set in HWConfig using CPU properties Call SFC28 SET T
15. Services and Subnets S7 Functions ISO Transport ISO on TCP FDL SDA 2 18 Hardware PROFIBUS FMS Fieldbus Message Specification provides services for transferring structured data FMS variables over static FMS connections The FMS service can be classified at layer 7 of the ISO reference model It corresponds to the European standard EN 50170 Vol 2 PROFIBUS and provides services for transferring structured data variables PROFIBUS DP services allow transparent communication with distributed I O devices These distributed I O devices are addressed by the control program in exactly the same manner as centralized I O devices Global Data Communication is a simple communication option integrated in the operating system of S7 300 400 CPUs GD communication permits cyclic exchange of data between CPUs via the multipoint interface for S7 400 it also allows event driven data exchange FMS DP GD From S5 to S7 Converter Manual 2 19 A5E00171227 01 Interface to User Programs The communication interface to a user program consists of the following blocks e SFCs without connection configuration e SFBs with connection configuration only S7 400 e Loadable FCs FBs These blocks replace the S5 handling blocks The functionality here is similar but it is now accomplished using STEP 7 languages To establish communication you will have to adapt an appropriate S5 program with handlin
16. double word MD 2 S7 DO FW 2 T FW 0 T MW MD2 The controller loads input byte IB 8 and transfers the contents to memory word FW 8 MW 8 in STEP 7 Using the Correct When working with a memory indirect address that is stored in the memory Sequence Syntax area of the data block you must first open the data block by using the Open data block instruction OPN After this you can use the data word or data double word as the indirect address as shown in the following example OPN DB10 L IB DBD 20 When accessing a byte word or double word first make sure that the bit number of the pointer is 0 Register Indirect In STEP 7 the address registers AR1 and AR2 are used for indirect Addressing addressing With indirect addressing the address specifies the memory location of the value that will process the instruction The address consists of the following two parts e An address identifier e An address register and a pointer for indicating the offset added to the content of the address register in order to determine the exact address that the instruction is to process The pointer is indicated by P Byte Bit The address points indirectly to the address of the value It does this by using the address register plus the offset An instruction that uses area internal register indirect addressing does not change the value in the address register For further information see the Statement List Programming Manu
17. gt A on board 4 on board I O address area Inputs 128 Inputs 496 e digital 10 on board 20 on board Outputs 128 Outputs 496 inputs outputs 6 on board 16 on board analog Inputs 64 inputs outputs 4 on board Outputs 64 1 on board C MUN all retentive data Local data 512 bytes in 1536 bytes in total total 256 bytes per priority class 256 bytes per priority class Blocks OBs FBs FCs DBs SFCs SFBs From S5 to S7 Converter Manual 2 6 A5E00171227 01 Hardware 57 400 CPUs The CPUs for the S7 400 have different performance features Table 2 2 shows a comparison of the performance features of these CPUs Table 2 2 Performance Features of the S7 400 CPUs Feature CPU CPU CPU CPU CPU CPU CPU 412 1 413 1 413 2 DP 414 1 414 2 DP 416 1 416 2 DP Work memory 128 128 384 512 0 8 1 6 Load memory 8 Kbytes 8 Kbytes 16 Kbytes e integrated e expandable with memory card 128 bytes each 256 bytes each 512 bytes each inputs and outputs I O address area 2 Kbytes 8 Kbytes 16 Kbytes e digital inputs outputs 16384 65536 131072 max e analog inputs outputs 1024 4096 8192 up to 15 Mbytes up to 15 Mbytes up to 15 Mbytes max Bit memory 4096 8192 16384 M 0 0 to M 511 7 M 0 0 to M 1023 7 M 0 0 to M 2047 7 Counters 256 256 512 C 0 to C 255 C 0 to C 255 CO toC 511 Timers 256 256 512 T 0 to T 255 T 0 to T 255 T 0 to T 511 4 Kbytes in total 8 Kbytes in total 16 Kbytes in total Retentive Features T
18. in an absolute sense For further information about data types see the Statement List Programming Manual 232 Formats in S5 Example Formats in S7 Example KB L KB 10 k8 L B 16 A KF L KF 10 k16 L 10 KH L KH FFFF 1 L 16 FFFF KM L KM 1111111111111111 2 L 2 11111111_11111111 KY L KY 10 12 B L B 10 12 KT L KT 10 0 SSTIME SST L SSTIME 100ms KC L KC 30 C L C 30 DH L DH FFFF FFFF 16 L DW 16 FFFF FFFF KS L KS WW UXXC L WW KG L KG 234 09 Floating point L 2 34 E 08 Representation S5 format Repr Single format compl with ANSI IEEE gt Exponent gt Mantissa gt gt Exponent gt Mantissa gt 31 30 234122 0 31 30 294 0 SE 2 s IM Dass ane 2 23 Shake gen A OBRA ai A Exponent value of exponent Exponent actual exponent bias 127 SE sign of the exponent S sign of the mantissa SM sign of the mantissa Range of values 1 5 x 1077 to 1 7 x 1038 Range of values approx 1 18 x 10738 to 3 4 x 10 38 From S5 to S7 Converter Manual 3 31 A5E00171227 01 Software 3 11 Address Areas 3 11 1 Overview Table 3 11 Addresses in 55 and 7 Address Areas Addresses in S5 Addresses in S7 Remark Inputs I I Outputs Q Q I O P Q G PI for load commands Shared I O is not PQ for transfer converted commands Bit memory flag area F M 5 M from M 256 0 Converter Scratchpad flags L Converted like flags Timers T T Co
19. lt gt R gt R lt R gt R lt R INVI NEGI NEGD BTI BTD DTB ITB RND DTR New in S7 ITD RND RND TRUNC INVD NEGR AW OW XOW New in S7 AD OD XOD SLW SLD SRW SRD SSI SSD RLD RRD New in S7 RLDA RRDA OPN SFC22 New in S7 CDB L DBLG L DBNO L DILG L DINO SS F F xF D D G G xG G IF gt lt F gt F lt F gt F gt D gt lt D D lt D gt D lt D G gt lt G gt G lt G gt G lt G CFW CSW CSD DEF DED DUF DUD GFD FDG AW OW XOW SLW SLD SRW SRD SVW SVD RLD RRD G CX G GX Software Table 3 12 Instruction Type Integer math instructions Floating point math instructions Comparison instructions Conversion instructions Word logic instructions Shift and rotate instructions Data block instructions continued on next page From S5 to S7 Converter Manual A5E00171227 01 3 36 Software Conversion Option Substitute by calling SFC26 SFC27 or master control relay instructions Substitute by calling SFC46 STP Call of DB code block must be newly programmed Recommendation substitute with register indirect addressing Must be substituted with indirect addressing see Section 3 13 4 Must be substituted with indirect addressing see Section 3 13 4 Substitute by calling SFC20 BLKMOV Substitute by
20. the number This word or double word can be located in one of the following areas e Bit memory flag M e Data block DB e Instance data block DI e Local data L The advantage of memory indirect addressing is that you can dynamically modify the address of the statement when editing the program Examples The following examples show how you can work with a pointer in word format STL S7 Explanation L 5 Load the value 5 as an integer in ACCU 1 T MW 2 Transfer the contents of ACCU 1 into the memory word MW2 L T MW 2 Load the time value of the timer T 5 The following two examples show how you can work with a pointer in double word format STL S7 Explanation L P 8 7 Load 2 0000 0000 0000 0000 0000 0000 0100 0111 binary T MD 2 value in ACCU 1 S7 Save the address 8 7 in the memory word FW 2 S5 memory double word MD 2 S7 MD 2 The controller queries the input I 8 7 and assigns its signal state to the output Q 8 7 From 55 to S7 Converter Manual A5E00171227 01 I 0 MD 2 A Software Memory Indirect Addressing STL S5 GRB 9 T FW 2 DO FW 2 IE S STL S5 I KB g L KB 7 TEY 2 DO FW 2 A I 0 0 DO FW 2 O 0 0 3 44 Software STL S5 STL S7 Explanation DREO L PHS LO Load 2 0000 0000 0000 0000 0000 0000 0100 0000 binary DO FW 2 T MDZ value in ACCU 1 S7 DO FW 2 Save the address 8 in memory word FW 2 S5 memory L IB 0
21. you should make sure that the STEP 5 address area is not exceeded otherwise an error will be reported during the first cycle of the conversion process If this occurs these instructions will not be converted Delete all repeated non convertible parts of the program until there is only one unique STEP 5 instruction for each part of the program This unique instruction can be assigned a macro to replace the part of the program see Section 5 4 If your program contains very many and long data blocks having no structure such as those used as data buffers you can delete the data words in these data blocks until only one data word remains After converting but before compiling you can program the contents of these data blocks in the source file by using an array declaration such as buffer ARRAY 1 256 of WORD With the converter you can not only convert complete programs but also individual program blocks From S5 to S7 Converter Manual A5E00171227 01 5 3 5 4 Preparing for Conversion Creating Macros When converting you can define macros for the following e S5 instructions that cannot be automatically converted and e 5 instructions that you want to convert differently from the standard conversion Macros can be useful if your program contains many 55 instructions which correspond to the characteristics listed above Macros can replace the following e S5 instructions e S5 organization blocks OBs
22. 0 Create positive edge S L1 1 Then switch on clockwise R ELLS Reset position reached A 4 Operate motor counter clockwise AN T0237 Disable no operation clockwise AN Vds lf and clockwise not active FP MOT Create positive edge S L1 2 Then switch on counter clockwise R los Reset position reached O A 50 5 Right limit switch reached and A Tels clockwise active O EP OL A 15 65 Left limit switch reached and A counter clockwise active S 4358553 lt Position set reached O LO 1 Stop motor switch pushed or O position reached R 7 gt Reset motor operation R L1 2 END L IMAGE_OUTPUT BYTE Copy local data to output byte T OUTPUT BYTE END_FUNCTION Figure 9 4 Motor Control Function From 55 to S7 Converter Manual A5E00171227 01 9 7 Application Example 9 3 Evaluating the Startup Information from the Diagnostic Interrupt OB If the organization blocks are called by the operating system the user is provided with system wide startup information in the local data stack This startup information is 20 bytes long and is available after OB processing has started The startup information from the diagnostic interrupt OB contains the logical base address with four bytes of diagnostic information The exact structure of this startup information is described in the Reference Manual 235 Templates for the corresponding variable declaration table are located in the
23. 16 x 24 VDC with hardware and diagnostic interrupt 16 x 24 VDC M reading 8 x 120 230 VAC Ex 4 24 VDC From S5 to S7 Converter Manual 2 15 A5E00171227 01 Hardware Table 2 5 Signal Modules in SIMATIC S7 400 DI DO AI AO SM 421 SM 422 SM 431 SM 432 32x DC 24 V 32x24 VDC 0 5 A 8x I3 bit 8 x 13 bit 16 x 24 60 VUC 16x 24 VDC 2 A 8 x 14 bit with hardware and for temperature diagnostic interrupt measurement 16 x 120 230 VUC 16 120 230 VAC 8x I4 bit ISA 32 x 120 VUC 16 x 120 230 VAC 16 16 bit 2 A 16 x 30 230 VUC Rel 5 A 2 2 7 Simulation Modules S7 300 S7 300 provides a simulation module SM 374 for testing your program This simulation module has the following capabilities e tcan simulate 16 inputs 16 outputs or 8 inputs and 8 outputs each having the same initial address e Its functions can be set with a screwdriver e It can provide status displays for simulating inputs or outputs From S5 to S7 Converter Manual 2 16 A5E00171227 01 Hardware 2 3 Distributed I O Devices The modules for distributed I O devices in the ET 200 system which already existed in SIMATIC S5 can continue to be used in SIMATIC S7 In addition there are new ET 200 modules to extend the range DP Masters The following modules can be a DP master in the distributed I O system e 7 300 with CPU 315 2 DP or CP 342 5 as DP m
24. 3 13 Addressing 3 13 1 Absolute Addressing The absolute addressing in S5 and S7 1s identical with one exception In 57 data in data blocks are addressed in bytes that is word addresses in S5 are transformed into byte addresses by being multiplied by 2 The following table shows the assignment during this conversion data area addressing S5 S7 DE 0 1 2 3 255 DBB 0 2 4 6 510 DR 0 1 2 3 255 DBB 1 3 5 7 511 DW 0 1 2 3 255 DBW 0 2 4 6 510 DD 0 1 2 3 254 DBD 0 2 4 6 508 D x y DBX 2 x y for8 lt y lt 15 DBX 2 x 1 y fr 0 gt lt 7 3 13 2 Symbolic Addressing The symbolic addressing in S5 is also used in S7 However there are now new options for creating and using the symbols There are no differences in programming Symbols in STEP5 Symbols for STEP 5 programs are declared with the help of the symbol editor This editor generates an assignment list which allows you to use the symbols defined there instead of absolute addresses Symbols in STEP7 In S7 symbols can be up to 24 characters long Shared Symbols STEP 7 also has a symbol editor but the assignment list ZULI is now known as a symbol table In it you can declare all shared symbols such as inputs outputs bit memory flags and blocks When you assign symbols with the symbol editor these are valid for a CPU program From S5 to S7 Converter Manual A5E00171227 01 3 39 B
25. BOOL Id OB82_WTCH_DOG_FLT BOOL 77 OB82_INT_PS_FLT BOOL 77 OB82_PRIM_BATT_FLT 001 OB82 BCKUP BATT FLT BOOL OB82 RESERVED 2 BOOL 7 7 OB82 RACK FLT BOORIS OB82 PROC FLT BOORLs7J OB82 EPROM FLT BOOLI 7 OB82 RAM FLT BOOL Figure 9 5 Diagnostic Data Evaluation From S5 to S7 Converter Manual A5E00171227 01 Application Example 0582 ADC FLT BOOL ADC DAC error OB82_FUSE_FLT BOOL Fuse blown OB82_HW_INTR_FLT BOOL Hardware interrupt lost OB82 RESERVED 3 BOOL Reserved OB82 DATE TIME DATE AND TIME Date and time when OB was called END VAR BEGIN NETWORK TITLE Diagnostic Interrupt OB82 MDL ADDR Save module address DB DIAG MDL ADDR OB82_EV_CLASS Event class B 16 38 B 16 38 Outgoing event GO Incoming event OB82_EXT_VOLTAGE Check if no ext auxiliary voltage DB DIAG NO EXT VOLTAGE Set bit TIME Outgoing event 0282 EXT VOLTAGE Ext auxiliary voltage present again R DB DIAG NO EXT VOLTAGE Reset bit NETWORK TITLE Save Time TIME CALL SFC20 SFC BLKMOV SRCBLK OB82 DATE TIME Save date and time at which RET VAL DB DIAG SFC RET VAL diagnostic interrupt DSTBLK DB DIAG DATE TIME was requested END ORGANIZATION BLOCK Figure 9 6 Diagnostic Data Evaluation continued From S5 to S7 Converter Manual 9 10 A5E00171227 01 Application Example Block Transfer You can use the system function SFC20 BLKMOV block move to copy the contents of one memory area the s
26. Comments are contained in the respective block in the offline database 3 17 Comparison of Blocks STEP 5 STEP 7 STEP 7 Block Organization blocks OB System functions SFC System function blocks SFBs Function FC Function block FB Data block DB System data blocks SDB CPU parameter assignment Table 3 2 STEP 5 Block Organization block OB Integrated special OBs Function block FB FX Program block PB Sequence block SB Data block DB DX Data block DXO DB1 in its special function Comment blocks DK DKX FK FKX PK From S5 to S7 Converter Manual A5E00171227 01 Software 3 2 Functions and Function Blocks Functions FCs are logic blocks without a memory The output parameters contain the calculated function values after the function is processed It is then up to the user how the actual parameters are used and saved after the FC is called Do not confuse functions with function blocks In STEP 7 these are different types of blocks Function blocks FB are logic blocks which do have a memory The memory is in the form of an instance data block which is associated with the function in which the actual parameters and static data of the function block are stored Function blocks are used for applications such as programming controller structures Functions FCs Function Blocks FBs 3 7 3 Data Blocks Data blo
27. From 55 57 Converter Manual A5E00171227 01 Appendix pp Literature List B From 55 57 Converter Manual A5E00171227 01 S7 STL International Q QB QD QW DBX DBW DBD DBB DBB I IB ID IW M MB MD MW PIW PQW PIB PQB PIB PQB PIW PQW M MD MW S7 STL German AT AB AD AW DBX DBW DBD DBB DBB E EB ED EW M MB Mp MW PEW PAW PEB PAB PEB PAB PEW PAW M MD MW Address and Instruction Lists The following addresses are converted Convertible Addresses S5 STL International T on ne ON n m m DD m D m ne m mer m r e 5 2 Tu m n e Table A 1 S5 STL German SAT AB AD AW BF D DW Dp DR DL EB ED EW MB MD MW pw py QB QW gn Sp SW A 1 Addresses Convertible Addresses From S5 to S7 Converter Manual A5E00171227 01 S7 STL International MB 6 is ds t Formal parameter2 S7 STL German MB T PZ Formal parameter gt Table A 2 shows the addresses that cannot be converted S5 STL International JNE mo mr n m Tem D T m ns Tm Em S ETE From S5 to S7 Converter Manual A5E00171227 01 Address and
28. Special The interface between the user program and the system program in 55 CPUs Functions consists of accesses made to the operating system area and via special OBs In 57 CPUs this interface has two new block types system functions and system function blocks in addition to the organization blocks System System functions SFCs and system function blocks SFBs are blocks Functions System integrated in the CPU operating system which can be called in a STEP 7 user Function Blocks program as needed If an error occurs during processing of a system function SFC this error can be evaluated in the user program with the aid of the RET VAL return value S5 Block Replacement in S7 SFC43 RE TRIGR OBS Error reaction can be programmed by user STEP 7 instruction L STW T STW STEP 7 instruction sequence L 0 PUSH PUSH PUSH Function not identical STEP 7 instruction PUSH Function not identical STEP 7 instruction POP SFC41 DIS AIRT SFC42 EN AIRT SFC39 DIS IRT SFC40 EN IRT SFC41 DIS AIRT SFC42 EN AIRT SFC39 DIS IRT SFC40 EN IRT SFCO SET CLK SFCI READ CLK From S5 to S7 Converter Manual A5E00171227 01 Table 3 5 Special Functions in 55 and 7 OB31 OB34 OB110 1 OB112 OB113 OB120 OB121 OB122 OB123 OB150 Function Cycle time triggering Battery failure Access to condition code byte Delete ACCU 1 4 Roll up ACCU Roll down ACCU Disable all interrupts on off Di
29. VAC 1A 24 VDC PS 407 20A 20 A 5 VDC 120 230 VAC 1A 24 VDC PS 405 4A 4A 5 VDC 24 VDC 0 5 A 24 VDC PS 405 10A 10A 5 VDC 24 VDC 1A 24 VDC PS 405 20A 20 A 5 VDC 24 VDC 1A 24 VDC For further information see the Reference Manuals 71 and 101 From S5 to S7 Converter Manual A5E00171227 01 Power Supply Modules for S7 300 Power Supply Modules for S7 400 2 8 Hardware 2 2 3 Interface Modules IM Some interface modules in S5 have been replaced in S7 This change primarily affects local area connections In S7 it is recommended that PROFIBUS be Description Central configuration Remote area up to 100 m Connection of I O modules and signal preprocessing modules up to 200 m Use of distributed I O in remote areas up to 600 m Distributed connection of 55 expansion devices in remote areas up to 600 m Connection via fiber optic cable up to 1500 m Distances up to 3000 m S7 400 Module IM 460 0 IM 461 0 IM 460 1 IM 461 1 IM 460 3 IM 461 3 Connection via PROFIBUS Connection via PROFIBUS IM 463 2 Connection via PROFIBUS Connection via PROFIBUS used to transmit signals for remote area connections S7 300 Module IM 365 IM 360 IM 361 Connection via PROFIBUS Connection via PROFIBUS Connection via PROFIBUS Connection via PROFIBUS In 57 the interface module IM 467 can be used in place
30. VALUE Input value UPPER LIMIT Upper limit for the analog value LOWER LIMIT Lower limit for the analog value END VAR BEGIN NETWORK TITLE Checking Upper and Lower Limits Ol L INPUT VALUE Input value gt Upper limit L 27648 gt E Ores Or L INPUT VALUE Input value Lower limit L 27648 IE L If upper or lower limit exceeded no further processing return value 0 and BR 90 If no upper or lower limt exceeded gt BR 1 NETWORK TITLE Converting Digital Value into Revolutions L UPPER LIMIT Formula for converting INPUT VALUE into revolutions LOWER LIMIT Analog value UPPER LIMIT LOWER LIMIT INPUT VALUE 55296 number of units INPUT VALUE Convert value into floating point number 99296204 RET_VAL END FUNCTION Figure 9 2 Analog Value Processing From S5 to S7 Converter Manual 9 4 A5E00171227 01 Application Example 9 2 Temporary Local Data Temporary local data function as buffer storage and thus replace the scratchpad flags used in S5 Temporary local data can be used in all logic blocks These data are lost after a logic block has been processed they are located in the local data stack L stack Example 1 This first example uses the temporary local data that are symbolically addressed as a buffer A preset speed is converted into the digitalized measured value for the analog output module having a resolution of 14 bi
31. and read the size of the available address areas In the Blocks tab there 1s 1nformation on the available blocks This includes the maximum number and length of the blocks types as well as all OBs SFBs and SFCs present on the CPU Or To adapt the STL program being converted so that it can run on the CPU check it for the permitted number of blocks and addresses and modify as necessary 5 3 Range of Functions of the CPU Adapting the Converted Program From 55 to S7 Converter Manual A5E00171227 01 Preparing the 55 Program Preparing for Conversion Before actually converting your STEP 5 program you can prepare it for its future use as a STEP 7 program However you do not have to do this first all necessary corrections can also be made in the STEP 7 source file after the conversion This initial adaptation will reduce the number of error messages and warnings occurring during conversion For example you can make the following adaptations to the STEP 5 program before proceeding with the conversion Evaluate system settings in the data blocks with the program properties DB1 or DXO After this you can delete DB1 and DXO Remove all calls from integrated blocks or accesses to the system data area this functionality can be achieved by assigning parameters to the S7 CPU Adapt all input output and peripheral address areas to the new module addresses by using the STEP 5 function Rewire When doing this
32. and which have diagnostic capability Digital input modules in S7 that can be assigned parameters allow you to specify with the STEP 7 application for configuring hardware which channels are to trigger a hardware interrupt on edge change The input ranges of analog input modules can be easily assigned parameters with STEP 7 Modules with diagnostic capability can detect both external errors such as wire breaks or external short circuits and internal ones such as RAM errors or short circuits within modules A diagnostic event is processed by the controller in the following two ways e By triggering a diagnostic interrupt This notifies the appropriate organization block OB in the user program which then interrupts the cyclic program e By making an entry in the diagnostic buffer of the CPU which can then be read with a programming device or operator interface device The following tables list the signal modules available in S7 Signal Modules which can be Assigned Parameters Signal Modules with Diagnostic Capability Table 2 4 Signal Modules in SIMATIC S7 300 DO AI AO SM 322 SM 331 SM 332 32 x 24 VDC 0 5 A 8 x 12 bit 2 x 12 bit 16 x 24 VDC 0 5 A 2 x I2 bit 8 x 24 VDC 0 5 A with Ex 4 x 15 bit Ex 4 x 15 bit diagnostic interrupt 8 24 VDC 2 A Ex 12 x 15 bit 8 x 120 230VAC AI 4 AO 2 X 8 8 bit SM 334 2A Ex 4x 15 VDC 20m A Ex 4 x 24 VDC 20m A DI SM 321 32 x 24 VDC 16 x 24 VDC
33. calling SFC39 42 3 37 Conversion yes yes no no no yes no no no no Instructions in S5 and in S7 continued S7 JU JC JN JZ JP JM JO JOS New in S7 JCN JCB JNB JBI JNBI JMZ JPZ JUO LOOP JL CALL BE BEU BEC New in S7 MCRA MCRD MCR MCR SFC46 Memory indirect addressing Area crossing register indirect addressing SFC20 SFC39 to 42 SS JU JC IN JZ JP JM JO JOS JUR JU JC DOU DOC BE BEU BEC BAS BAF STP STS STW DO lt Formal parameter gt DO FW DO DW DO RS LIR TIR LDI TDI TNB TNW TXB TXW LIM SIM IAE RAE IA RA Table 3 12 Instruction Type Logic control instructions jump Block instructions Command output instructions Master control relay instructions Stop commands Processing functions Absolute memory addressing Block transfers Interrupt commands continued on next page From 55 to S7 Converter Manual A5E00171227 01 Conversion Option S7 has no page access Conversion From S5 to S7 Converter Manual A5E00171227 01 Software Table 3 12 Instructions in 55 and in 57 continued ABS COS SIN TAN ACOS ASIN ATAN EXP LN BLD xxx NOP 0 NOP 1 ACR TSC TSG BLD xxx NOP 0 NOP 1 Instruction Type Page commands Math functions Null instructions 3 38 Software
34. cannot be downloaded to an S7 CPU Blocks are distinct parts of a user program and are distinguished by their function structure and use within it Blocks can be downloaded to S7 CPUs In addition to the executable blocks the Blocks container also contains the variable tables The symbol table shows the assignment of symbolic names for example for inputs outputs bit memory and blocks From S5 to S7 Converter Manual A5E00171227 01 Software Programmable Modules Connection Table Source Files Blocks Symbol Table 3 6 Software 3 3 Editing Projects with the SIMATIC Manager 3 3 1 Creating Projects New Project To create a project follow the steps outlined below 1 Select the menu command File New in the SIMATIC Manager 2 Select the option New Project in the New dialog box 3 Enter a name for the project and confirm your entry with OK Alternative When editing a project you are flexible as to the order in which you perform Procedures most of the tasks Once you have created a project you can choose one of the following methods e First configure the hardware and then create the software for it or e Start by creating the software independent of any configured hardware The hardware configuration of a station does not need to be established before entering a program Table 3 1 Alternative Procedures see also Section 3 4 Configure your hardware Once the configuration is com
35. input output and I O parameters According to the International Electrotechnical Commission s IEC 1131 3 standard functions are logic blocks that do not reference an instance data block meaning they do not have a memory A function allows you to pass parameters in the user program which means they are suitable for programming complex functions that are required frequently for example calculations As there is no memory available the calculated values must be processed immediately following the FC call According to the International Electrotechnical Commission s IEC 1131 3 standard function blocks are logic blocks that reference an instance data block meaning they have static data A function block allows you to pass parameters in the user program which means they are suitable for programming complex functions that are required frequently for example control systems operating mode selection As function blocks have a memory in the form of the associated instance data block its parameters outputs for example can be accessed at any time and any point in the user program The distributed I O consists of analog and digital modules which are located at a physical distance from the central rack Characteristic of the distributed I O is the modular rack system whose aim it is to save connecting wires thereby saving costs by placing the I O modules close to the process An instance is the call of a function block an insta
36. is displayed in the upper list box in the Converting S5 Files window and contains the errors and warnings in the converted program These messages are generated during both conversion runs and also during conversion of the assignment list 6 5 From S5 to S7 Converter Manual A5E00171227 01 Conversion After the conversion runs are completed a dialog box displays the total number of errors and warnings made in the converted program Converting 5 Files 01262551 550 FI Warning in Line 169 STEP 5 ASCII File FB 16 rel Addr OH Preheader not available S7U5CAPX Warning in Line 169 STEP 5 ASCII File FB 185 rel Addr OH Output not allowed product no Error in Line 7060 PB 211 Block not available CALL FB 180 Error in Line 12270 SB 38 Block not availab CALL FB 16 Error in Line 13459 SB 40 Block not availabl CALL FB 16 Figure 6 5 Messages When Converting From S5 to S7 Converter Manual 6 6 A5E00171227 01 Conversion In the lower list box in the window you can display the location in the file at which the error occurred Messages are output in the STL source file at the points in the program at which errors were detected This file also contains warnings or indications that problems might occur for example due to changes in the instruction semantics Select the menu command File gt Print to print out the message files you require lV M lV
37. it does not exist in the program file 2nd run Block is called that does not exist Check whether the cross reference in the program file list was specified or check the program structure CALL OB is not allowed 2nd run Calling OBs is not allowed in S7 If necessary use the statement CALL SFC CALL SFC xy generating 2nd run Parameters for SFC missing Complete the SFC parameter list please extend parameter list Command in block not Istrun For example jump within a Check the instruction allowed program block Comment too long Istrun Error in 55 file Check the program file Conversion error 2nd run BI without constant Include a constant with the load instruction Directory not available Istrun Program file does not contain any Check the program file blocks Error in macro file Macro xy 2ndrun Macro error Check the macro instruction ignored Error in parameter Istrun Error in the 55 program Check the program file From S5 to S7 Converter Manual A5E00171227 01 6 8 Conversion Error Message Source Meaning Remedy File not found general Selected file does not exist Check the program file Invalid MC5 code was Istrun Conversion of an older S5 None converted instruction Invalid operator Istrun Operator in 55 file not known or Replace the operator with the cannot be converted appropriate S7 instruction Invalid operator may be 2nd run The operator cannot be loaded int
38. of IM 308C You can use the interface module IM 463 2 to connect S5 digital and analog modules to the S7 mounting rack with IM 314 via an S5 expansion rack 2 9 The following S5 expansion racks can be connected e EG 183 expansion unit e EG 185 expansion unit e ER 701 2 e ER 701 3 Comparison of IM Modules S5 Module IM 305 IM 306 IM 300 IM 312 IM 301 IM 310 IM 304 IM 314 IM 307 IM 317 IM 308 IM 318 Connectable S5 Expansion Racks From S5 to S7 Converter Manual A5E00171227 01 Hardware 2 2 4 Communications Processors CP The following section lists the 55 and S7 communications processors that can be used in various subnets In addition the services supported by these processors are also indicated In order to meet the varying requirements of different automation levels such as on the processing cell field and actuator sensor levels SIMATIC provides the following subnets AS Interface The actuator sensor interface AS i is a connection system for the lowest processing level in automation systems It is primarily used for networking binary sensors and actuators Its data quantity 1s limited to a maximum of 4 bits per slave MPI The multipoint interface MPI subnet is intended for short range field and cell levels The MPI is a multipoint interface used in SIMATIC S7 M7 and C7 It is designed as a programming device interface and is intended for n
39. part of this station A station consists of one or more programmable modules such as a CPU Hardware Hardware is an object containing the configuration data and parameters for a station The configuration data and parameters for a station are stored in system data blocks SDBs From S5 to S7 Converter Manual A5E00171227 01 3 5 In contrast to other modules programmable modules contain user programs In the folders known as containers in STEP 7 found in the programmable modules you will find all the data belonging to the program for the module Examples of such programs are the following e Programs in source file form created with a text editor When the source program is compiled executable blocks are created in the Blocks container e Blocks which are loaded into the programmable module e Symbol tables The connection table depicts all connections for a programmable module such as a CPU in a station A connection defines the communication properties between two nodes and is identified by a connection ID This connection ID is all that you need to program event controlled communication using standardized communication blocks which are similar to the handling blocks found in STEP 5 In S7 programming source files are the basis for creating blocks Source files
40. 0 Programming Programming Manual System Software for S7 300 and S7 400 Program Design Reference Manual System Software for S7 300 and 87 400 System and Standard Functions Manual Function Block Diagram FBD for S7 300 and S7 400 Programming Manual Continuous Function Chart CFC Volume 2 7 Manual Structured Control Language SCL for S7 300 and S7 400 Programming Manual GRAPH for S7 300 and S7 400 Programming Sequential Control Systems B 1 Literature List 21 30 70 71 T2J 100 101 102 231 232 233 234 235 236 249 250 251 From S5 to S7 Converter Manual A5E00171227 01 Manual HiGraph for S7 300 and S7 400 Programming State Graphs Manual C Programming for S7 300 and S7 400 Writing C Programs Manual Continuous Function Chart CFC Volume 1 Manual S 7 PDIAG for S7 300 and S7 400 Configuring Process Diagnostics for LAD STL and FBD Manual NETPRO Configuring Networks Programming Manual System Software for M7 300 and M7 400 Program Design Reference Manual System Software for M7 300 and M7 400 System and Standard Functions User Manual System Software for M7 300 and M7 400 Installation and Operation User Manual ProC C for M7 300 and M7 400 Writing C Programs User Manual ProC C for M7 300 and M7 400 Debugging C Programs Manual SIMATIC NET NCM S7 for Industrial Ethernet Manual SIMAT
41. 000 0 E 6 1 Starting the Conversion 6 2 Generated Files 6 3 Interpreting Messages 0 ccc eee en Editing the Converted Program 000 cece cece eee eee eee 7 1 Address Changes nananana 7 1 1 Options for Changing Addressing 0 7 2 Non Convertible Functions 0 0 0 0 c cece eee eee teens 7 3 Indirect Addressing Conversion llle lees 7 4 Working with Direct Memory Accesses 05 From S5 to S7 Converter Manual A5E00171227 01 vill Contents 7 5 Assigning Parameters 0 00 ccc eee 7 5 7 6 Standard Functions cd ee os dcn de gm oo cR e Xo e lob d ae 7 6 Compiling the Program ssse IIR ens Application Example sesee HH mmm 9 1 Analog Value Processing 202002 eens 9 2 9 2 Temporary Local Data 9 5 9 3 Evaluating the Start Information from the Diagnostic Interrupt OB OB82 9 4 5 77 9 5 Calling the Examples ssssssss cece een een eee ees A Address and Instruction Lists lessen A 1 aded eant E A 2 INSIGICHONS B Literature List 1 1 111111 111111111001 menn GIOSSAlY 2 00400002 00 SE Glossary 1 I E From S5 to S7 Converter Manual A5E00171227 01 IX From 55 57 Converter Manual A5E00171227 01 os Invoduction Conversion Introduction 1 From 55 57 Converter Manual A5E00171227 01 Introduction Until now you were fa
42. 122 and delete the other OB 122 OB was interpreted as OB 34 2nd run Depending on the CPU used the Check whether this OB matches from S5 115U OB 34 can have different your program meanings Output not allowed 1 GRAPH 5 blocks cannot be You may have to insert a GRAPHS block converted GRAPH 7 block Output not allowed Istrun S5 standard function block must None product no be replaced by an S7 FC Please check time interval 2nd run Time intervals can be more Adjust the time interval using the settings precisely set in S7 than in S5 function Hardware Configuration Please observe different STOP 2nd run No distinction has been made Check the program file Check whether the preheaders exist in another file If necessary insert the instruction CLEAR Assign parameters to the programmable controller using STEP 7 Make the system settings using the configuration table From S5 to S7 Converter Manual A5E00171227 01 between STP STS and STW For FBs and FXs the jump label identifiers are missing for DBs and DXs the data formats are missing With the S5 instructions SU and RU the RLO is set in S7 MASK is in DWO and DW1 DB and DX will be converted but do not have the same meaning as in S5 lst run 2nd run lst run 2nd run commands Preheader not available RLO is set S5 screen DB was not used to assign parameters to S7 System preferences cannot be set by the 55 57 Converter
43. 1227 01 Glossary Symbol Symbol Table V Variable Glossary 6 Block transfers 3 37 Block types in S5 and S7 Blocks comparison STEP 5 STEP 7 CPU 2 6 2 7 Blocks container STEP 7 object BR register 7 5 C Cam control CD ROM Command output instructions Comment block Communication event driven Communication functions Communications processors Comparison instructions Compiling 8 1 Complete restart Configuration tool Configuring communication connections hardware 3 9 Connection configured to S5 station Connection table STEP 7 object Consistency check Constant format Controller module Conversion requirements Conversion instructions Convertible address A 1 instruction COROS 2 3 Counter instructions Counter module Counters CPU CP modules 2 10 Index 1 Index A Absolute address Accumulator instructions Actuator sensor interface Adapter casing 2 13 Address convertible non convertible Address allocation Address areas overview Address changes Address register Addressing absolute data addresses indirect converting memory indirect register indirect symbolic Analog functions Analog value processing example 9 2 ANY pointer AS i 2 10 AS511 2 3 ASCII source file Assignment list 3 39 6 1 6 4 Authorization 3 2 B Background processin
44. 2 COUNT MW 102 RET VAL MW 106 RET VAL MW 106 DB NUMBER MW 104 DB NUMBER MW 104 SENDMACRO 5 6 Preparing for Conversion 5 4 2 OB Macros Due to the differences in the organization blocks between S5 and 57 it may be advisable to control the conversion of your instructions with S5 OBs yourself In this case OB macros must be structured as follows SOBCALL Number of the OB CALL S7 system function SENDMACRO If an instruction with the address OB x is found in the S5 source file this instruction is replaced by the defined macro instructions Exceptions to this are the FB calls that use OBs as formal parameters Table 5 2 Example of an OB Macro Macro S5 S7 SOBCA LIS 31 Replaces instructions JU OB 31 CALL SFC43 with OB31 CALL SFC 43 SENDMACRO Notes on Creating The functions of the organization blocks in S5 are different from those of the OBs OBs in S7 OBs that cannot be converted automatically must be replaced by the following e OBs with a different range of functions e New S7 instructions or e System settings which are defined when assigning the hardware parameters For detailed information about replacing S5 OBs see Section 3 7 5 Note There is no check to determine whether a macro is defined twice If this happens to be the case then the first macro defined is used There is no check to determine whether the specified S7 instruction sequence is corr
45. 5 STL German SPR USPS SPZ USRD USRW SS USSVU SU Sy USVWTU SVZ aa he U INB UINW U UN ZR ZW Table A 4 Non Convertible The following table shows the S5 STL instructions that cannot be converted Instructions automatically Table A 5 Non Convertible Instructions S5 STL German S5 STL International AAS IAT AAF RAI ABR ABR ACR ACR AFF RAE AFS IAE ASM ASM BAF BAF From S5 to S7 Converter Manual A5E00171227 01 Address and Instruction Lists Non Convertible Instructions S5 STL International BAS DI can only be converted for parameter type D constant BLD LB LD LD lt Formal parameter gt can only be converted for parameter type D constant EDI LIM LIR LRB LRD ULRW LW LWz Formal parameter gt can only be converted for parameter type D constant MAI MAB MAS MBA MBR MBS MSA MSB SEE USED SIM TB UIDI IIR TSC TSG TRB TRD TW TXB Table A 5 S5 STL German BAS BI can only be converted for parameter type D constant BLD LB TIT LD Formal parameter gt can only be converted for parameter type D constant LDI LIM LIR
46. 6 10 Editing the Converted Program The following preparations are necessary to edit the STL source file generated during conversion e Make a printout of the messages generated during conversion e Create an S7 program in a project in the SIMATIC Manager if you have not already done so Import the STL source file program into the Source Files container of this S7 program using the menu command Insert gt External Source File e Open the converted file To edit the generated STL source file we recommend the following procedure e Work through the program in interactive mode and modify or supplement the S5 instructions and organization blocks that were not converted based on the warnings see Part 1 Preparing to Edit Editing the File From S5 to S7 Converter Manual 7 1 A5E00171227 01 Editing the Converted Program 7 1 Address Changes Usually input and output modules are affected by address changes The addresses for these modules can be found in HWConfig 7 1 1 Options for Changing Addresses Before converting you can use the Rewire function to adapt the addresses of individual addresses in 55 to the new addresses in S7 The SIMATIC Manager contains a function for automatically rewiring blocks generated from your source file To rewire blocks proceed as follows Select the blocks in your program to be rewired in the SIMATIC Manager 2 Open the t
47. A statement is the smallest independent part of a user program created in a textual language It represents a command for the processor Statement List is a textual representation of the STEP 7 programming language similar to machine code Pointer Programming Language Project R Retentive 5 57 Program Shared Data Statement Statement List STL From S5 to S7 Converter Manual Glossary 5 A5E00171227 01 A symbol is a name defined by the user taking syntax rules into consideration This name can be used in programming and in operating and monitoring once you have defined it for example as a variable a data type a jump label or a block Example Address 15 0 Data Type BOOL Symbol Emer Off Switch A distinction is made between shared symbols and block specific symbols Shared symbols are available to all parts of the program therefore the symbol you assign must be unique for the whole user program Block specific symbols are only recognized within the block for which they were assigned A table used to assign symbols or symbolic names to addresses for shared data and blocks Examples Emer Off Symbol I1 7 Address Controller Symbol SFB24 Block A variable defines an item of data with variable content which can be used in the STEP 7 user program A variable consists of an address and a data type and can be identified by means of a symbolic name From S5 to S7 Converter Manual A5E0017
48. ALS ANALOGVAL 2 Measured range 10V DB MEASVALS DIGITALVAL 2 RET VAL digitalized meas value call function for motor control Call function for block transfer Source DB100 From data byte DBB 0 Length 4 Byte Destination DB110 From data byte DBB 6 Length 4 bytes RET_VAL Error code for SFC20 BLKMOV 9 15 AL 2 2 hy fa iy Measured range P3 Ei Ei by 2 P 7 Z E 1 DATA BLOCK DB MEASVALS TITLE Measured Values NAME DB MEASVALS VERSION 01 00 STRUCT ANALOGVAL_1 REAL ANALOGVAL 2 REAL DIGITALVAL 2 INT END_STRUCT BEGIN END DATA BLOCK DATA BLOCK DB MOTOR 1 TITLE Motor Data NAME DB_MOTOR_1 VERSION 01 00 STRUCT CONTROL WORD WORD SPEED REAL TEMPERATURE REAL CURRENT REAL END STRUCT BEGIN END DATA BLOCK ORGANIZATION BLOCK 1 TITLE Call in Cycle NAME CYCLE VERSION 01 00 VAR_TEMP STARTINFO ARRAY 1 20 of BYTE END_VAR BEGIN NETWORK TITLE Call of Functions CALL FC1 INPUT VALUE IW 0 UPPER LIMIT 10 0 LOWER LIMIT 10 0 RET VAL CALL FC2 INPUT VALUE UPPER LIMIT 10 0 LOWER LIMIT we RET_VAL CALL FC3 INPUT BYTE IB 4 OUTPUT BYTE OB 8 CALL FC4 SOURCE DBNO 100 SOURCE_BEGIN EU SOURCE LENGTH 8 DEST DBNO 110 DEST BEGIN 2 DEST LENGTH 8 RET VAL ERROR END ORGANIZATION BLOCK Figure 9 10 OBI From S5 to S7 Converter Manual A5E00171227 01
49. D gt lt ST lt D DED DEF DUD ENT Lp p pe XE 09 p UBXFU Sp EU ep FDG LG GG eu xG Instructions A 2 Conversion Instructions without Addresses From S5 to S7 Converter Manual A5E00171227 01 Convertible Instructions without Addresses continued S7 STL International lt gt R SR eg CR RND INVI NEGD NEGTI 0 O OW CALL SFC 46 CALL SFC 46 CALL SFC 46 DTAK A C AW XOW y NETWORK Table A 4 shows all the S5 instructions with addresses in STL that can be converted automatically into S7 STL S7 STL International OPN 95 95 29 OPN Instruction sequence for indirect addressing S7 STL German lt gt R SR R eg cR RND INVI NEGD NEGI 0 O OW CALL SFC 46 CALL SFC 46 CALL SFC 46 TAK UC UW XOW y NETWORK Convertible Instructions with Addresses S7 STL German AUF 99 99 99 99 99 99 AUF Instruction sequence for indirect addressing From S5 to S7 Converter Manual A5E00171227 01 S5 STL Internati
50. Data Areas NAME COPY VERSION 01 00 VAR_INPUT SOURCE DBNO j DB no of source area SOURCE BEGIN Data word no of beginning of source area SOURCE_LENGTH gt Length of source area in bytes DEST_DBNO DB no of destination area DEST_BEGIN Data word no of beginning of dest area DEST LENGTH Length of destination area in bytes END VAR VAR TEMP POINTER SOURCE ANY pointer for the source area POINTER DEST ANY pointer for the destination area END VAR BEGIN NETWORK TITLE Preparing Source Pointer P 4POINTER SOURCE Load address of pointer in source area into address register 1 W41641002 Write area ID for data area in LW AR1 P 0 0 ANY pointer for source SOURCE DBNO Write DB no in ANY pointer for source LW AR1 P 4 0 SOURCE_BEGIN Convert beginning of data area 35 into pointer format DW4 16484000000 Link area ID LD AR1 P 6 0 and write in ANY pointer for source SOURCE LENGTH Write length of data area in ANY pointer LW AR1 P 2 0 for source continued Figure 9 8 Copying Data Areas From S5 to S7 Converter Manual A5E00171227 01 9 13 Application Example NETWORK TITLE Preparing Destination Pointer L P POINTER_DEST Load address of pointer to dest area in address register 1 W 1l6 1002 Write area ID for data area in LW AR1 P 0 0 ANY pointer for destination DEST_DBNO DB no in ANY pointer for destination LW AR1 P 4 0 DEST BEGIN Convert beginning of data area 3 into pointer
51. E00171227 01 1 3 Editing the Converted Program 7 3 Indirect Addressing Conversion The S5 S7 Converter uses STEP 7 instructions to convert indirect addressing with DO FW and DO DW The instruction sequence generated is generally very extensive since the STEP 5 pointer has to be converted into STEP 7 format and the accumulator contents and the status word must be buffered when doing so If your program contains very frequent indirect addressing then it is worth adapting to the indirect addressing in STEP 7 A substantial amount of memory space can be saved by using appropriate programming techniques The list below explains how the S5 S7 Converter converts indirect addressing in different cases Indirect addressing of timers and counters is converted into memory indirect addressing by using a temporary local data word Indirect addressing of blocks is converted into memory indirect addressing by using a temporary local data word The new block numbers cannot be taken into account during conversion and must therefore be corrected The indirect addressing of addresses is converted by bits and words into register indirect addressing by using the address register ARI and temporary local data as a buffer for the status word STW ACCU 1 and ACCU 2 The instructions are not converted Indirect addressing must be reprogrammed in S7 The instructions must be reprogrammed in S7 For further information on indirect addressing see Sect
52. I O area 3 35 Conversion TAK ENT INC DEC New in S7 CAW CAD PUSH POP LEAVE New in S7 LARI LAR2 TARI TAR2 AR1 AR2 SET A SET AN SET S SET R New in S7 X XN X XN FP EN NOT SET CLR SAVE SP SE SD SS SE FR ST CU CD FR 5C LIGT L PIB L PIW T PQB T PQW Instructions in S5 and in S7 TAK ENT I D ADDBN ADDKF ADDDH MAI MBR ABR MAS MAB MSB MSA MBA MBS TSG LRB LRW LRD TRB TRW TRD A AN O ON AG OG O S R RB RD TB TBN SU RU SP SE SD SS SSU SF SFD FR SEC CU SSU CD SFD FR SEC L LD LW LDW TL PB L QB L PW L QW T PB T QB T PW TQW LY GB GW GDb CB CW CD LW GW GD CW CD TY GB GW GD CB CW CD TW GW GD CW CD 3 12 Table 3 12 Instruction Type Accumulator instructions Address register instructions Register instructions Bit logic instructions Timer instructions Counter instructions Load and transfer instructions continued on next page From S5 to S7 Converter Manual A5E00171227 01 Conversion Option Substitute by calling SFC22 CREATE_DB Conversion yes yes yes yes yes yes yes no Instructions in 55 and in 57 continued S7 1 1 I l D D D D New in S7 MOD R R R R LLE D lt gt D gt D D lt lt R
53. IBUS The following table provides an overview of the modules available for SINEC L2 communicating with PROFIBUS and which services are supported by these modules S5 Module S7 300 Module S7 400 Module CP 5431 FMS FDL DP CP 342 5 CP 443 5 Ext CPU 95U FDL DP S7 functions FDL DP S7 functions FDL DP CP 343 5 CP 443 5 Basic S7 functions FDL FMS S7 functions FDL FMS IM 308 B C DP CPU 315 2 DP DP CPU 413 2 DP DP CPU 414 2 DP DP CPU 416 2 DP DP IM 467 DP depends on the specific equipment ordered Industrial Ethernet The following table provides an overview of the modules available for SINEC H1 communicating with Industrial Ethernet and indicates which services are supported by these modules S5 Module S7 300 Module S7 400 Module CP 1430 TF ISO transport CP 343 1 CP 443 1 S7 functions ISO transport S7 functions ISO transport CP 1430 TCP ISO on TCP CP 343 1 TCP CP 443 1 TCP S7 functions ISO on TCP S7 functions ISO on TCP From S5 to S7 Converter Manual A5E00171227 01 2 11 The following table provides an overview of the modules available for point to point connection and which services are supported by these modules S7 400 Module CP 441 1 3964 R RK512 ASCID CP 441 2 3964 R RK512 ASCII additional special drivers which can be loaded From S5 to S7 Converter Manual A5E00171227 01 S7 300 Module CP 340 RS 232C 3964 R
54. IC NET NCM S7 for PROFIBUS DOCPRO Creating Documentation CD only TeleService for S7 C7 and M7 Remote Maintenance for Automation Systems CD only PLC Simulation for S7 300 and 87 400 CD only Reference Manual Standard Software for S7 300 and S7 400 STEP 7 Standard Functions Part 2 CD only From S5 to S7 Converter Manual A5E00171227 01 252 253 254 270 271 280 281 282 290 291 500 301 800 801 802 803 Literature List B 2 Actual parameters replace formal parameters when a function block FB or function FC is called for example the formal parameter START is replaced by the actual parameter 13 6 An address includes the address identifier and the physical memory location where the address is stored Examples Input 112 1 Memory Word MW25 Data Block DB3 An address is part of a STEP 7 statement and specifies what the processor should execute the instruction on Addresses can be absolute or symbolic Assigning parameters means setting the behavior of a module Blocks are part of the user program and can be distinguished by their function their structure or their purpose STEP 7 provides the following types of blocks e Logic blocks FB FC OB SFB SFC e Data blocks DB SDB e User defined data types UDT A block call is the branch into the called block taken during program processing Block parameters are token v
55. INT Set in HWConfig using CPU properties 3 2 Table 3 8 Converting the System Settings from DXO S5 Parameter Block Addressing error monitoring Updating the IPC flags Startup types after power on Start synchronization in multiprocessor operation Number of timer cells Error handling Floating point math Process hardware interrupt triggering Timed cyclic interrupt processing mode Cycle time monitoring From S5 to S7 Converter Manual A5E00171227 01 Software 3 9 Standard Functions During conversion the standard functions present in 55 are automatically replaced by converted functions having the same functionality In S7 most of these functions can be replaced by simplified command sequences which conserves memory and reduces the cycle time The standard functions are contained in the StdLib30 S7 library located in the program container FBLib1 For further information on working with libraries refer to the online help Name GP MUL GP DIV GP VGL RAD GP Name MLD EZ MLD ED MLD EZWK MLD EDWK MLD EZK MLD EDK STEP 7 STEP 7 Number FC65 FC66 FC67 FC68 Number FC75 FC76 FC77 FC78 FC79 FC80 From S5 to S7 Converter Manual A5E00171227 01 STEP 5 FB Name GP MUL GP DIV GP VGL RAD GP STEP 5 FB Name MLD EZ MLD ED MLD EZWK MLD EDWK MLD EZK MLD EDK Floating Point Math STEP 7 Name GP_FPGP GP_GPF
56. Instruction Lists Table A 1 Convertible Addresses S5 STL S5 STL German International SY ROY T dd as PZ TC Formal Formal parameter gt parameter gt Non Convertible Addresses S5 STL German Non Convertible Addresses Table A 2 Fer T a eem XT n m s DAT Dope uS TT Address and Instruction Lists Table A 3 shows all the S5 instructions without addresses in STL that can be converted automatically into S7 STL S7 STL International CALL SFC42 CALL SFC41 BEU BEC 1D p Ty lt gt D D ep BTD BTI DTB ITB ENT 4p J LI lt gt SI SI e eI DTR LR _R aie g A 3 Convertible Instructions without Addresses S7 STL German CALL SFC42 CALL SFC41 BEA BEB 1D p 2p D SD ST ep ep BTD BTI DTB ITB ENT LI J e Le DP SI m e en DTR AR gt R g S5 STL International RA A BEU BEC Lp p IL p gt lt D ep esp DED DEF DUD DUF ENT Lp ope po XE 09 Lp gt lt F sp op epo ep FDG LG G ew XG Table A 3 S5 STL German AE AS BEA BEB pD Ty I
57. LRB LRD ULRW LWz Formal parameter gt can only be converted for parameter type D constant MAI MAB MAS MBA MBR MBS MSA MSB SEF USES SIM TB UIDI IIR UISC UISG TRB IRD TRW TW TXB From 55 to S7 Converter Manual A5E00171227 01 S5 STL International Address and Instruction Lists Table A 5 Non Convertible Instructions S5 STL German From S5 to S7 Converter Manual A5E00171227 01 UDXWU UBE UDXWU UB E 9 Technical Overview S7 M7 Programmable Controllers Distributed I O with PROFIBUS DP and AS i Primer 7 300 Programmable Controller Quick Start Manual 7 300 Programmable Controller Hardware and Installation Reference Manual 587 300 and M7 300 Programmable Controllers Module Specifications Instruction List 7 300 Programmable Controller CPU 312 IFM 314 IFM 313 314 315 2DP Manual 7 400 M7 400 Programmable Controllers Hardware and Installation Reference Manual 597 400 M7 400 Programmable Controllers Module Specifications Reference Guide 7 400 Instruction List CPU 412 413 414 416 User Manual Standard Software for S7 and M7 STEP 7 Manual Statement List STL for S7 300 and 87 400 Programming Manual Ladder Logic LAD for S7 300 and 87 40
58. MOTOR LEFT respectively The motor can only be operated in one direction at a time Before changing the direction of motor rotation the motor must be paused with the STOP switch If a travel limit switch is reached the motor is stopped The EMERGENCY STOP button also stops the motor if this occurs then the motor can be restarted only after the EMERGENCY STOP button has been reset From S5 to S7 Converter Manual A5E00171227 01 9 6 Application Example FUNCTION EG3T VOID TITLE Motor Control NAME MOTOR VERSION 01 00 VAR INPUT INPUT BYTE BYTE Input byte END_VAR VAR IN OUT OUTPUT BYTE BYTE Output byte END VAR VAR TEMP IMAGE INPUT BYTE BYTE Image of input byte IMAGE OUTPUT BYTE BYTE Image of output byte END VAR BEGIN NETWORK TITLE Motor Control IE INPUT BYTE Copy input byte into local data area WR IMAGE INPUT BYTE L OUTPUT BYTE Copy output byte into local data area T IMAGE OUTPUT BYTE ON L0 O0 Motor not switched on no voltage ON ROZ or EMERGENCY_STOP button pushed R L1 0 gt Motor is ready to reset R ELit gt Reset motor control R palus s R Liso gt Reset position reached JC END gt No further signal evaluation A L0 O0 Motor switched on S L1 0 gt Set motor switched on A T0 9s Operate motor clockwise AN L0 4 Disable no operation counter clockwise AN Iul 2s and counter clockwise not active FP M0
59. NS 2122 20 00 05000520 canst cabowesesancd drugs dean 3 9 Standard Functions 3 9 1 Floating Point Math 3 9 2 FURCIONS ie 20 002 225d gue we EPL SR ca EFE E Sec 3 9 3 Integrated Functions 3 9 4 Sle Ir UMC HONS ares sianie 9h wes ap oe ee decease eae Am ener 3 9 5 Analog IUrnctloFiS 2 a deatur ucc ex Oe aono IR 3e i o e rac 3 9 6 Math FUNCIONS A r Rem 3 10 ala TVDES dpa RE arii md wer eee Mabe as SIE 3 11 Address 202 00 920 ose Gees dee eee 553920 0090988 gaill WEMIEW 0 0 8 3 11 2 New Addresses in S7 Local Data 3 12 iu t UCUO cheng FUE ores pee ate y undc ore S vien P LU Iesu d d 3 13 2 8 3 13 1 Absolute Addressing 0 c cece ne 3 13 2 Symbolic Addressing 202 3 13 3 New Feature Complete Addressing of Data Addresses 3 13 4 Indirect Addressing 00001 ne 0 m 2 00 02250000 4 1 Analyzing the S5 System 0 eee eens 4 2 Creating an S7 Project 4 3 Configuring Hardware lseseeeeeeee teens Preparing for Conversion 2 5 0 6 e dor deRUM Dura 5 1 Providing the Required Files 0000 5 2 Checking Addresses esee 5 9 Preparing the S5 Program ens 5 4 Creating Macros sseeeeeee hs 5 4 1 Instruci n Macros 8 x1 8 8 etm cen ise ei Ric Sn Roe ER d ee 5 4 2 OB M 5 4 3 WIACIOS a porre TENE ETT TIT CODVerSIOB 2 2 004
60. P GP_ADD GP_SUB Signal Functions STEP 7 Name MLD_TG MELD_TGZ MLD_EZW MLD_EDW MLD_SAMW MLD_SAM Integrated Functions STEP 7 Name COD_B4 COD_16 MUL_16 DIV_16 Number FC61 FC62 FC63 FC64 Number FC69 FC70 FC71 FC72 FC73 FC74 Number FC81 FC82 FC83 FC84 3 9 1 STEP 5 FB Name GP FPGP GP GPFP GP ADD GP SUB 3 9 2 STEP 5 FB Name MLD TG MELD TGZ MLD EZW MLD EDW MLD SAMW MLD SAM 3 9 3 STEP 5 FB Name COD B4 COD 16 MUL 16 DIV 16 3 28 Software 3 29 STEP 7 Name REG_LIFO DB_COPY DB_COPY RETTEN LADEN COD_B8 COD_32 STEP 7 Name AE_466_1 AE 466 2 RLG AAI RLG AA2 PER ETI PER ET2 STEP 7 Name ARCCOT LN X LG X B LOG X EH N ZEHN A2_H_Al Number FC93 FC94 FC95 FC96 FC97 FC98 FC99 Number FC106 FC107 FC108 FC109 FC110 FCIII Number FC119 FC120 FC121 FC122 FC123 FC124 FC125 STEP 5 FB Name REG LIFO DB COPY DB COPY RETTEN LADEN COD B8 COD 32 STEP 5 FB Name AE 466 AE 466 RLG AA RLG AA PER ET PER ET STEP 5 FB Name ARCCOT LN X LG X B LOG X E X ZEHN X A2 A 3 9 4 Basic Functions STEP 5 STEP 7 FB Name Number Name ADD 32 FC85 ADD_32 SUB 32 FC86 SUB_32 MUL 32 FC87 MUL_32 DIV 32 FC88 DIV_32 RAD 16 FC89 RAD_16 REG SCHB FC90 REG_SCHB REG SCHW FC91 REG_SCHW REG
61. Part 1 Planning Your Part 2 Converting Programs Preparing for Conversion CD 5 Co o A O N Editing the Converted Program Application Example Address and Instruction Lists gt O 2 5 5 S x SIEMENS SIMATIC STEP 7 From 55 to 7 Converter Manual Edition 12 2002 A5E00171227 01 This manual contains notices which you should observe to ensure your own personal safety as well as to Safety Guidelines 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 indicates that death severe personal injury or substantial property damage will result if proper precautions indicates that death severe personal injury or substantial property damage can result if proper precautions indicates that minor personal injury or property damage can result if proper precautions are not taken Danger ZN are not taken Warning are not taken Caution ZN Note draws your attention to particularly important information on the product handling the product or to a The device system may only be set up and operated in conjunction with this manual particular part of the documentation Qualified Personnel Only qualified personnel should be allowed to install and work on this equipment Qualified persons are defined as persons who are authorized to commis
62. SPP Timer Z hler S5 STL International BA DOC D G GX ER I ae LD NOP o ON TB UDIBN R RB RD RLD RLW RRD RRW RU S SP SFD SD Sp USLD USEW Ju C IMP INU Jo Jp Table A 4 S5 STL German BA BAB D EX ER I Lc NOP o ON spe R RB RD RLD RLW RRD URRW RU 7 SA SAR SE SI USLD USEW SPA SPB SPM SPO From 55 57 Converter Manual A5E00171227 01 Convertible Instructions with Addresses continued S7 STL International JU JOS Jz SRD USRW SS ii e Timer CU Counter SET S SE SSD SS SET Timer UN Counter Tq CALL SFC20 CALL SFC20 AD AN CD CU S7 STL German SPA PSPS USPZ USRD USRW Ss SS Timer PZV Z hler SET S SV SSD SS SVU Timer S Z hler o CALL SFC20 CALL SFC20 U UN ZR ZW S5 STL International JUR JOS Iz USRD USRW Ss USSU IAS SE SSW SEC T TNB TNW A AN CD CU Address and Instruction Lists S
63. STOP mode Table 3 4 Error Handling in 55 and 7 Function S5 S7 Calling a block which is not loaded OB19 OB121 Timeout with direct access to I O modules OB23 OB122 Timeout updating the process image and the OB24 OB122 IPC flags interprocessor communication flags Addressing error OB25 OB122 Cycle time exceeded OB26 OB80 Substitution error OB27 Omitted Stop by operator OB28 Omitted S5 135U Timeout with input byte IB 0 OB28 OB85 S5 155U Illegal instruction code OB29 STOP S5 135U Timeout with direct access to I Os in the OB29 OB122 extended address area S5 155U Illegal parameter OB30 Omitted S5 135U Parity error or timeout accessing user memory OB30 OB122 S5 155U Special function group error OB31 Omitted Load and transfer error with a data block OB32 1 Collision of timed interrupts OB33 OB80 Controller error OB34 Omitted S5 135U Error generating a data block OB34 SFC feedback S5 155U Communication error OB35 OB84 3 21 From S5 to S7 Converter Manual A5E00171227 01 Software Troubleshooting in S5 and S7 Exceeded Signal As in S5 you can also use the status word bits OV and OS to evaluate a report of an exceeded signal The difference in behavior in the two systems is minor For further information about the behavior of status bits with reference to instructions see the Statement List Programming Manual 232 Integrated
64. Symbol Meaning This documentation introduces the methodology N This is a reference manual on a specific topic The documentation is supported by online help Prime S7 300 Programmable Controller 1 Quick Start 30 Manuals on Manual S7 300 S7 400 Hardware System Software for S7 300 S7 400 Program Design Standard Software for Standard Software for S7 and Converter From S5 to 7 STEP 7 a aT STL LAD FBD SCL 232 2330 p36 qgsol Reference System Software for Manual S7 300 400 ee O umm System and Standard GRAPH HiGraoh CFC for 7935 Functions p or Ese Soe el for S7 7 sul nsu l ns Language Packages Number in the list of references Figure 1 1 S7 Information Landscape From S5 to S7 Converter Manual IV A5E00171227 01 Preface S7 Documentation Content Subject The Primer offers a basic introduction to the methodology of the structure and programming of an S7 300 S7 400 It is especially suited to first time users of an 7 programmable control system The 57 300 57 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 first time user of an S7 300 or S7 400 should use this manual to acquire an overview of the programming methodology and to use it to base their user program de
65. able used for rewiring by selecting the menu command Options Rewire 3 Enter the old and new addresses for each address in the table and then save them The blocks now contain the changed addresses In your program adapt access to inputs and outputs as well as direct I O access to the new module addresses in S7 In the 57 source file you can easily make changes to the absolute addresses by selecting the menu command Edit Replace Caution If the old and new address areas overlap then unintended changes can occur If you want to use symbolic addressing you can also use the symbol table to do the rewiring Before rewiring you must already have a compiled program that is error free and a symbol table that contains all the symbols necessary for modifying the absolute addresses From S5 to S7 Converter Manual A5E00171227 01 Rewiring in 5 Rewiring in S7 Changing Addresses in the S7 Source File Generating a New Symbolically Addressed S7 Source File Prerequisite 1 2 Editing the Converted Program Procedure To change the addresses proceed as follows 1 Open a block containing addresses to be changed Select the option Symbolic Representation in the Editor tab of the dialog box opened with the menu command Options Customize Repeat this procedure for all blocks containing addresses that you wish to change 2 Generate a source file from the blocks by selecting the menu command File
66. access can only be done in connection with the shared data block register DB register During complete addressing the STL editor issues statements 1 Open the data block via the DB register such as OPN DB100 2 Access the data address such as L DBW 6 You have the option of using completely addressed access for all instructions that are allowed for the data type in the data address being addressed Completely addressed data addresses can also be specified as block parameters This is strongly recommended since it is possible for the data block to be switched when it is called Complete addressing ensures that the correct data address 18 transferred from the correct data block Example Possible Operations Using Completely Addressed Data Access From S5 to S7 Converter Manual 3 41 A5E00171227 01 In principle it is possible to access data addresses in the same way as in STEP 5 partial addressing Example L DBW 6 L SPEED In STEP 7 this may cause problems because STEP 7 changes the registers for the S7 300 S7 400 CPU during various operations In some cases the DB number in the DB register will be overwritten The DB register may be overwritten in the following situations Thus particular care must be taken here The DB register is overwritten during data access using complete addressing If a function block FB is called then the data block register for the calling block 18 overwritten After a cal
67. al 232 From S5 to S7 Converter Manual A5E00171227 01 3 45 From 55 57 Converter Manual A5E00171227 01 Procedure Preparing for Conversion Conversion Compiling Application Example Part 2 Converting Programs From 55 57 Converter Manual A5E00171227 01 The programming of 57 in STL is largely compatible with 55 STL Similarly programming Ladder in 57 is compatible to 55 LAD and programming FBD in S7 is compatible to S5 CSF Thus if you are an S5 user and want to use existing programs in S7 this change is made much easier for you You can base the new system on your tried and tested S5 programs and convert them to S7 programs The following list tells you how to convert your S5 program and lists the sections where you will find the required information The list is intended as an example and as a guideline individual steps can also be skipped Procedure How to Proceed From S5 to S7 Converter Manual 4 1 A5E00171227 01 Procedure 4 1 Analyzing the S5 System Before you convert your S5 program you should clarify the following questions How can the functionality of the modules used in your 55 program be achieved in S7 Can your 55 modules be used in S7 with the help of adapter or interface modules Can your S5 modules be replaced with S7 modules How can the required system settings be implemented in S7 How can the range of instructions used by the 65 CPU be i
68. alled occupies 105 Mbytes on the hard disk The exact amount of space required depends on the amount of standard software installed e STEP 7 should also have about 64 Mbytes of total memory available for storing swap files For example if you have 32 Mbytes of RAM you will need an additional 32 Mbytes of virtual memory e Approx 50 Mbytes should be available for user data e A minimum of 1 Mbyte free memory should be available on the hard disk for setup The setup files are deleted once the installation is complete From S5 to S7 Converter Manual A5E00171227 01 3 1 Software 3 1 2 Installing the STEP 7 Software STEP 7 contains a setup program that carries out the installation automatically User prompts appearing on the screen guide you step by step through the entire installation procedure A product specific user authorization is required to use the STEP 7 programming software Software protected in this manner can only be used if the required authorization for the program or software package is located on the hard disk of the respective programming device or PC To obtain this authorization you need the copy protected authorization diskette included in the consignment This diskette also contains the program AUTHORS which is required to display install and uninstall STEP 7 The procedure for transferring and removing this authorization is described in the User Manual 231 Note Siemens programming devices such a
69. alues within multipurpose blocks which are supplied with current values when the corresponding block is called Glossary A Actual Parameter Address Assigning Parameters B Block Block Call Block Parameter From S5 to S7 Converter Manual Glossary 1 A5E00171227 01 The compiler program for compiling a program written in a higher programming language to the machine code the CPU uses is known as a compiler Configuring is the selection and putting together of the individual components of a programmable logic controller PLC and the installation of the required software and adapting it to the specific task such as assigning parameters to the modules Data blocks are areas in the user program which contain user data There are shared data blocks which can be accessed by all logic blocks and there are instance data blocks which are associated with a particular function block FB call Data blocks contain no logic instructions in contrast to all other types of block Static data are local data in a function block which are stored 1n the instance data block and thus remain stored until the next function block call Temporary data are local data in a block which are kept in the L stack while the block is in use and are no longer available once the block is closed With the help of data types you can specify how the value of a variable or a constant is to be used in the user program There are two data types accord
70. arameters of type B and then convert these instructions manually Actual Parameters For function blocks with parameters assigned the S5 S7 Converter applies the actual parameters to block calls without changing them If you have already defined addresses with an actual parameter you will have to check this address definition and change it if necessary Examples e Defining a data word number This must be converted into addressing done in bytes e Defining an I O address The new module address must be used e Transferring a block The block must include the new block number From S5 to S7 Converter Manual A5E00171227 01 1 5 Editing the Converted Program 7 6 Standard Functions If your S5 program contains standard function blocks SFBs they are indicated as follows e Before conversion by an asterisk in the Std column of the dialog box Converting S5 Files lt Name gt ST SS5D and e After conversion by displaying the message Output not allowed product no The STEP 7 Standard software is supplied with S7 functions that have already been converted former S5 standard function blocks for floating point math signal functions integrated functions basic logic functions and math functions with the names FC61 to FC125 see Section 3 9 To integrate the S7 functions into your S7 program proceed as follows 1 Open the project into which you want to insert the functions 2 Open the sta
71. aster e 7 400 with CPU 413 2 DP 414 2 DP 416 2DP or CP 443 5 extended as DP master DP Slaves The following are examples of devices which can be DP slaves in the distributed I O system e Distributed I O devices such as ET 200B ET 200C ET 200M ET 200X up to 12 Mbps and ET 200U ET 200L up to 1 5 Mbps e Programmable logic controllers such as 5 115U S5 135U or 55 155 with IM 308 C as DP slave 85 95 with DP slave interface up to 1 5 Mbps 7 300 with CPU 315 2 DP or CP 342 5 as DP slave 897 400 with CP 443 5 as DP slave e Interface to actuator sensor interface with the DP AS 1 link e Text displays and operator panels for machine like operator control and monitoring e MOBY identification systems e Low voltage switching devices e Field devices such as drives valve islands etc from Siemens or other manufacturers FMS Masters The following can serve as an FMS master 6 7 300 with CP 343 5 as FMS master 6 S7 400 with CP 443 5 Basic as FMS master FMS Slaves Examples of devices that can serve as an FMS slave are the ET 200U or the SIMOCODE motor protection and control device For further information refer to the appropriate manuals or the Siemens catalog CAOI From S5 to S7 Converter Manual A5E00171227 01 2 7 Hardware 2 4 Communication Communication within SIMATIC S7 is based on different subnets which provide various services Services S7 Communication Functions S7 Functions
72. ating your own libraries in the online help If you want to create a source file in Statement List select the Source Files or Charts object in the S7 program and then select the menu command Insert gt S7 Software gt Source File In the submenu you can select the source file which matches your programming language You can now open the empty source file and start entering your program An empty symbol table Symbols object is created automatically when the S7 program is created When you open the symbol table the Symbol Editor window opens displaying a symbol table where you can define symbols refer to Section 3 13 2 for more details Programs Existing Components Creating S7 Blocks Using Blocks from Standard Libraries Creating Source Files Creating a Symbol Table From S5 to S7 Converter Manual 3 15 A5E00171227 01 Software Inserting External You can create and edit source files with any ASCII editor You can then Source Files import these files into your project and compile them into executable blocks To insert an external source file proceed as follows 1 Select the Source Files container to which you want to import the source file 2 Select the menu command Insert gt External Source File 3 Enter the source file name in the dialog box which appears The blocks created when the imported source file is compiled are stored in the Blocks container From S5 to S7 Conv
73. cks store the data for the user program A distiction is made between shared data blocks and instance data blocks as explained in the following e Shared data blocks are not assigned to any particular block as in STEP 5 e Instance data blocks are associated with a function block FB and contain in addition to the FB data the data from multiple instances that may have been defined Every data block can either be a shared data block or an instance data block From S5 to S7 Converter Manual A5E00171227 01 3 18 Software 3 74 System Blocks You do not have to program every function yourself You can also program communication functions for example by using pre configured blocks that are available in the operating system on the CPUs These are the following e System functions SFCs with properties like those of functions FCs e System function blocks SFBs with properties like those of function blocks FBs The previous discussion was centered around blocks containing programs or data from the user program In addition to these blocks there are other blocks containing settings such as module parameters or addresses These are called system data blocks SDBs and are created by special STEP 7 applications for example when entering the hardware configuration or creating connection tables System Functions SFCs and System Function Blocks SFBs System Data Blocks SDB From S5 to S7 Converter Manual 3 19
74. ction must be made between PPI MPI and PROFIBUS as MPI nodes PPI or MPI connections run via the programming device interface in the CPU In doing so SIMATIC OP uses the communication services of SIMATIC S7 M7 S7 functions this means that a standard function block is not required The PROFIBUS connection from SIMATIC OP to SIMATIC S7 M7 also involves communication accomplished using S7 functions Again this means that a standard function block is not required SIMATIC OPs are active nodes and not PROFIBUS DP slaves as is the case for the PROFIBUS connection to SIMATIC S5 The same number of nodes that applies to an MPI connection also applies here The following operator panels OP can be used with S7 TD17 OP3 OP5 A2 OP7 DP OP7 DP 12 OP15 x2 OP17 DP OP17 DP 12 OP25 OP35 OP37 TP37 The following restrictions apply to SIMATIC OPs OP3 up to 2 connections 05 15 25 up to 4 connections TD17 OP7 17 up to 4 connections 0235 up to 6 connections 037 TP37 up to 8 connections Introduction Operator Panels STEP 5 STEP 7 From S5 to S7 Converter Manual 2 21 A5E00171227 01 SIMATIC ProTool and SIMATIC ProTool Lite are modern tools for configuring operator panels SIMATIC ProTool can be used to configure all devices while SIMATIC ProTool Lite can only be used to configure line oriented operator panels Functionally ProTool Lite is a subset of ProTool ProTool can be int
75. d the reference description of the programming language or representation type You only require one language type for programming an S7 300 S7 400 but you can mix the languages within a project if required If you are using a language for the first time it is recommended that you use the manual to learn about the methodology of creating a program in the chosen language first While you are working with the software you can access a range of online help topics which offer detailed support on using the respective editors compilers The languages GRAPH HiGraph and CFC Continuous Function Chart offer additional methods of programming blocks in the form of sequential controls state graphs or charts The manuals contain both the user s guide and the reference description of the programming language If you are using a language for the first time it is recommended that you use the manual to learn about the methodology of creating a program in the chosen language first While you are working with the software you can access a range of online help topics which offer detailed support on using the respective editors compilers with the exception of HiGraph Table 1 1 Title 957 300 Programmable Controller Quick Start Primer S7 300 and S7 400 Program Design Programming Manual S7 300 and S7 400 System and Standard Functions Reference Manual STEP 7 User Manual Converter Manual From S5 to S7 Statement List Ladder Log
76. e Byte Byte Byte Byte Byte Byte Byte n 2 n 3 n 4 n 5 n 6 n 7 n 8 n 9 Area pointer Data block no for data blocks Type Byte n 1 Table 9 4 B 16 10 Table 9 5 Byte n 6 Byte 7 Byte n 8 24 23 16 5 a 7 31 a 000 0rrr 0000 0 bbb bbbb bbbb bbbb b xxx Bits 2 to 0 xxx Bit address Number of addressed bit area 0 to 7 to 65 535 From S5 to S7 Converter Manual A5E00171227 01 Bits 18 to 3 bbbb bbbb bbbb bbbb Byte address Number of addressed byte area 0 Bits 26 to 24 Area ID for area crossing addressing Hon nm H HW m i OUZz O U UJ X x a indicates area internal addressing a indicates area crossing addressing Area Pointer Byte n 6 to Byte n 9 Figure 9 7 9 12 Application Example Example The example shows a function which uses the the system function SFC20 BLKMOV to copy data area in data blocks Variable source and target areas can be entered as parameters Principle The function contains two ANY pointers in the local data area and one ANY pointer for the target area As a rule the ANY data type can only be used for variables in the local data area In the function the ANY pointer is assigned a value as indicated in the structure previously described This value is indicated in the parameters when the SFC20 BLKMOV is called FUNCTION FC4 INT TITLE Copying
77. e of modules used in 57 corresponds to and expands on the known and proven module concept used in SIMATIC S5 S7 contains the following types of modules Central processing units CPU Power supply modules PS Interface modules IM Communications processors CP such as for connecting to PROFIBUS Function modules FM such as for counting positioning closed loop control Digital and analog modules are now called signal modules SM This chapter describes the similarities and differences in the range of modules used in SIMATIC S5 and SIMATIC 57 S7 modules can be distinguished by the following features The new modules are not equipped with jumpers or switches The new modules do not require cooling fans As in S5 they have the IP 20 protection class The new modules can be assigned parameters and have diagnostic capability The S7 slot assignment is more flexible than for S5 Expansion devices and ET 200 distributed I O devices can trigger interrupts From S5 to S7 Converter Manual A5E00171227 01 Hardware 2 2 S7 Modules No Fundamental Differences from S5 New Performance Characteristics 2 4 Hardware The following table compares the module parameter assignment in SIMATIC S5 and SIMATIC 57 SIMATIC S7 Modules are arranged hardware configuration using the STEP 7 application for configuring hardware Addresses are set with the STEP 7 application for configuring hardware or are s
78. ect Make sure that keywords and special characters colon are correctly written From S5 to S7 Converter Manual A5E00171227 01 5 7 Preparing for Conversion Editing Macros Macros are created as follows 1 Start the S5 S7 Converter by clicking the Start button in the Windows 5 taskbar and selecting Simatic STEP 7 Convert S5 files 2 Select the menu command Edit Replace Macro There must be no program file open Result The S7SSCAPB MAC file is opened 3 Enter the macros as described above and save the file with the menu command File Save 4 Close the file with the menu command File Close Result The S7SSCAPB MAC file is closed The macros are valid the next time you start a conversion run Converting S5 Files s7u5capB mac File Edit View Help S S x tS MACRO G DBO a SLW 1 5 T MW 102 CALL SFC 22 LOW LIMIT MW 100 UP_LIMIT MW 100 COUNT ie MW 102 RET VAL ie MW 106 DB NUMBER MW 104 ENDMACRO j Press F1 for help Figure 5 1 Macro in the Window Converting S5 Files From S5 to S7 Converter Manual A5E00171227 01 5 4 3 5 8 Conversion 6 1 Starting the Conversion Prior Before you start to convert programs make sure that the S5 file you want to Requirements convert the cross reference list and if necessary the assignment list are in the same directory see Section 5 1 Starting the S5 S7 After yo
79. ect name As in STEP 5 it is also possible in STEP 7 to create a simple user program intended for only one CPU In this case a project is limited to one CPU The following section discusses the directory structure that STEP 7 provides for the user programs and data that you create From S5 to S7 Converter Manual A5E00171227 01 Definition Projects in STEP 5 Projects in STEP 7 Note 3 4 Software Components of a A project in STEP 7 essentially consists of the objects depicted in Figure 3 2 Project These objects are listed and explained below Project Network Programmable Connection module table Container for all the data for a program Symbol table Program in 5 zT Blocks source file form Figure 3 2 Basic Objects in a STEP 7 Project with their Hierarchical Structure Network The Network object contains the definitive properties for a subnet such as MPI or PROFIBUS Assigning a station or a communication module within a station to a network enables STEP 7 to check communication parameters for consistency Station A station represents the structure of a programmable controller along with all the racks belonging to it If a module with a DP interface is part of a station then the entire master system that is the DP slaves belonging to it 1s also
80. ections to an 7 300 station The local configuration data for connection end points on an S7 station must be separately downloaded into each target station An empty connection table Connections object is automatically created for each CPU This connection table is used to define communication links between CPUs in a network After this is opened a window is displayed containing a table for defining connections between programmable modules For more information about defining connections see the User Manual 231 Overview Special Feature Loading Configuration Data From S5 to S7 Converter Manual 3 11 A5E00171227 01 Software Example This example shows you how to configure a connection to a SIMATIC S5 Connection to an station It assumes that you have already inserted a SIMATIC 400 station in S5 Device your project e Insert a SIMATIC 65 station in your project and then set the properties of the station e Open the connection table for the S7 station and select the menu command Insert Connections to insert a connection A dialog box is displayed in which you can enter the communication partner the SIMATIC 65 station and the type of connection e Once you have entered this information the connection appears in the connection table The properties for the connection must be entered in the corresponding COM NCM for the S5 station Verbpro zebra SIMATIC 400 Station 1 CPU413 1 1 Configuring Connecti
81. ed program after it has been checked for consistency or compiled they are listed under the source file in a second window section along with their cause If you then select an error message the location of the corresponding error in the source file will be displayed This coupling of error message with error location enables quick troubleshooting and error correction You can correct errors and make changes in overwrite mode Press the INSERT key to toggle between the insert and overwrite modes From S5 to S7 Converter Manual A5E00171227 01 Compiling the Program Troubleshooting 8 2 Application Example This chapter presents an application example illustrating four areas of operation that are either new in S7 or are now performed differently than in S5 e Analog value processing e Local data e Evaluation of startup information in the organization blocks e Block transfer In this example a motor operating to the right clockwise and left counter clockwise is controlled by means of a digital I O module The speed is read by an analog input module and can be output by an analog output module The digital and analog modules used in this example must be able to trigger a diagnostic interrupt Configuration DI DO Al AO He Speed control Speed measurement Figure 9 1 Configuration of the Application Example From 55 to S7 Converte
82. egrated in the SIMATIC STEP 7 configuration software this Hardware Configuration Integration in SIMATIC STEP 7 enables direct access to configuration data such as symbol tables and communication parameters used for control configuration This feature not only saves time and money it also prevents errors resulting from redundant data entry Table 2 6 Configuration Tools for Operator Interface Devices Device Configuration Tool Line oriented OP TD17 OP3 OP5 OP7 OP15 ProTool Lite or ProTool OP17 Graphic oriented OP OP25 OP35 OP37 TP37 ProTool WinCC can be used for a single or multi terminal client server arrangement system WinCC is a system for creating solutions to visualization and process control tasks used in production and process automation it is compatible with all business sectors and technologies It provides function modules suitable for displaying graphics and messages archiving information and record keeping in industrial applications Its powerful and efficient hardware connection quick display updating and secure data archiving provide users with high flexibility and availability In addition to these system functions WinCC also provides open interfaces for creating user specific solutions These allow WinCC to be integrated in complex company wide automation solutions Integrated features allowing access to data archives via standard interfaces such as ODBC and SQL and integration of
83. er Manual 2 0 A5E00171227 01 Hardware Programming device interface MPI Multipoint Interface for programming devices and operator panels The programming device interface AS511 used in SIMATIC S5 has been replaced by the multipoint interface MPI for S7 300 and S7 400 This multipoint interface provides a direct electrical connection for HMI devices HMI Human Machine Interface previously known as COROS and for programming devices to the programming device interface used by SIMATIC S7 The interfaces are completely integrated The following table provides a direct comparison of these two interface specifications 25 pin TTY interface 20 mA 9 pin sub D interface with RS485 technology Transmission rate 9 6 Kbps Transmission rate 187 5 Kbps Protocol 3964R Protocol S7 functions Max length of network 50 m with bus amplifiers or special cables up to 1000 m All programmable modules within a configuration can be addressed via the multipoint interface One device can be connected Up to 31 devices can be connected Bus interface for Operator Panels OP Programmable logic controllers in the SIMATIC 55 and SIMATIC 57 automation families can be connected using the PROFIBUS previously known as SINEC L2 bus system As before these connections are bus specific Connecting Programming Devices and OPs to SIMATIC S7 From S5 to S7 Converter Manual 2 3 A5E00171227 01 The rang
84. erter Manual 3 16 A5E00171227 01 Software Blocks Comparison 3 7 3 7 1 The following table provides a comparison of the blocks in STEP 5 and STEP 7 The table is intended to answer the question Which STEP 7 block This table is not to be interpreted as a fixed one to one set of assignments since the new block environment makes additional programming options available should I use for which STEP 5 block No Fixed Assignment The table entries are to be understood as a set of recommendations for starting STEP 7 programming Explanation Interface to the operating system System functions in STEP 7 replace the special organization blocks STEP 5 that can be called in the user program Functions FCs in STEP 7 have the same properties as function blocks in STEP 5 Program blocks correspond to the function blocks in STEP 7 Function blocks in STEP 7 have completely new properties compared to blocks in STEP 5 having the same name thus they now provide new programming options Note During conversion program blocks are transformed into functions FCs There are no sequence blocks in STEP 7 In STEP 7 the data blocks are longer than in STEP 5 in S7 300 up to 8 Kbytes in 57 400 up to 64 Kbytes The new system data blocks contain all the hardware configuration data including the CPU parameter assignments which determine the program processing In STEP 7 there are no longer any comment blocks
85. esides being able to declare symbols with the symbol editor STEP 7 also gives you the option of specifying local symbols for data addresses and for the local data area when programming blocks If you assign symbols within a block instead of assigning them with the symbol editor then this symbol is only valid for the block concerned In this case the symbol is local to the block STEP 7 does not stipulate exactly when you have to specify your symbols When doing this you have the following two options e Specify them before beginning to program This 18 required if the user program is input incrementally that is if the program syntax is checked after each line is created e Specify them after creating the user program but before compiling This is required if the user program is input in free edit mode that is if the program is created as an ASCII file source file In S7 you have the option of creating and editing the symbol table with the editor of your choice You can import tables that you created with another tool into your symbol table and then edit them further For example the import function can be used to add assignment lists created in STEP 5 ST after conversion The following data formats are available SDF ASC DIF and SEQ To import a symbol table proceed as follows 1 Open the S7 program containing the symbol table in the project window 2 Double click the Symbols container to open
86. ette You must archive projects before saving them on diskettes Archives can then be split up over several diskettes You can store individual projects or libraries in compressed form in an archive file located on a hard disk or a transportable data medium diskette In order to be able to access components of an archived project or library the project must first be extracted from the archive Archiving is discussed in detail in the User Manual 231 From S5 to S7 Converter Manual A5E00171227 01 3 3 2 Overview Save As Archiving 3 8 Software 3 4 Configuring Hardware with STEP 7 SIMATIC S5 did not provide an option for configuring hardware using the software In 57 addressing and assigning parameters to modules and configuring communications is carried out by means of a STEP 7 application The advantage of this method is that the user no longer has to make any settings on the modules since the configuring and assigning of parameters can now be done centrally from the programming device To configure hardware a project must already have been created To create a new station in a project open the project to display the project window if this has not already been done 1 Select the project 2 Create the object for the required hardware by selecting the menu command Insert gt Station In the submenu you can select one of the following options e SIMATIC 300 station e SIMATIC 400 station e PC progra
87. etworking a small number of CPUs and for exchanging small quantities up to 70 bytes of data PROFIBUS PROFIBUS is the network used for the cell and field areas in open manufacturer independent SIMATIC communication systems PROFIBUS is suitable for quick transmission of moderate quantities of data approx 200 bytes Industrial Ethernet Industrial Ethernet is the network used for the processing and cell levels in open manufacturer independent SIMATIC communication systems Industrial Ethernet is suitable for quick transmission of large quantities of data Point To Point Connection A point to point connection is not a subnet in the traditional sense This connection is established in SIMATIC by using point to point communications processors CP to connect two communication partners such as PLCs scanners PCs with each other From S5 to S7 Converter Manual A5E00171227 01 Subnets in SIMATIC 2 10 Hardware AS Interface The following table provides an overview of the modules available for SINEC S1 communicating via the actuator sensor AS interface S5 Module S7 300 Module S7 400 Module CP 2433 AS i functions CP 342 2 AS i functions CP 2430 AS i functions MPI SINEC L1 Communication via SINEC L1 in S5 has been converted to global data communication using MPI in S7 All CPUs in 57 300 and 57 400 as well as the programming devices and operator panels have an MPI interface PROF
88. format DW 16 84000000 Link area ID LD AR1 P 6 0 and write in ANY pointer for destination DEST LENGTH Write length of data area to ANY pointer LW AR1 P 2 0 for destination NETWORK TITLE Copying Data CALL SFC 20 Copy data with SFC BLKMOV block transfer SRCBLK POINTER_SOURCE Pointer to source area RET _VAL RET VAL Return code of SFC BLKMOV DSTBLK POINTER DEST Pointer to destination area END FUNCTION Figure 9 9 Copying Data Areas continued 9 5 Calling the Examples This section contains the symbol table the data blocks required for assigning values to the block parameters and the organization block OBI with the calls for the functions previously described Table 9 6 Symbol Table Symbol Address Data Type Comments DB DIAG DB82 DB82 Diagnostic data block DB_MEASVALS DB 100 DB100 Data block for measured values DB_MOTOR_1 DB110 DB110 Data block for motor 1 ERROR MW 100 WORD Return value of the function FC4 for block transfer From S5 to S7 Converter Manual 9 14 A5E00171227 01 Application Example Analog value 1 from FCl Analog value 2 from FC2 ee ek Digitalized measured value from FC2 Control of motor 1 Speed of motor 1 Temperature of motor 1 Current consumption of motor 1 Call function for analog value processing da cuv DB MEASVALS ANALOGVAL 1 RET VAL Analog value Call function for calculating digitalized measured value DB MEASV
89. g Backup battery Basic functions Battery failure Bit logic instructions Bit memory CPU 2 6 2 7 Block instructions Block transfer example From S5 to S7 Converter Manual A5E00171227 01 Error messages 6 8 ET 200 2 17 Ethernet 2 10 Example analog value processing block transfer Start information temporary local data Expansion rack F FB See Function block FC See Function FDL SDA 2 18 File formats Floating point math 3 28 Floating point math instructions FM modules 2 13 FMS master 2 17 FMS service FMS slaves Fully integrated automation Function FC 3 17 3 18 Function block FB 3 17 3 18 Function modules FX See Function block G GD communication See Global data communication Global data communication 2 19 H Handling block Hardware STEP 7 object Hardware interrupt 2 15 3 20 HMI Human Machine Interface 2 3 2 21 IM modules 2 9 Importing ASCII source file symbol table Indirect addressing converting From S5 to S7 Converter Manual A5E00171227 01 Index CPU 5 3 analog inputs analog outputs bit memory 2 6 2 7 blocks counters DBs 2 6 2 7 digital inputs digital outputs 2 6 2 7 FBs FCs load memory 2 6 2 7 local data OBs process image 2 6 2 7 retentive data 2 6 S7 300 S7 400 SDBs SFBs SFCs timers w
90. g functions to the new blocks Interface in S7 User Program S7 300 loadable FBs S7 400 loadable SFBs Loadable FCs Loadable FBs Loadable FCs Loadable FBs From S5 to S7 Converter Manual A5E00171227 01 Interface in S5 User Program Handling blocks Handling blocks Handling blocks Handling blocks Handling blocks Handling blocks Handling blocks loadable FBs Handling blocks loadable FBs Service FDL PLC PLC Free Layer 2 FMS ISO 4 ISO 4 AP STF MAP Hardware 2 4 1 Network Point to point connection PROFIBUS Industrial Ethernet Integrated or loadable depending on CPU 2 20 Hardware 2 5 Operator Control and Monitoring The following section provides an overview of the extent to which SIMATIC HMI HMI Human Machine Interface previously COROS operator panels can be used in SIMATIC S7 The SIMATIC HMI operator panel provides operator control and monitoring functions for SIMATIC S5 SIMATIC S7 and SIMATIC TI as well as for other controllers In general a standard function block which is called depending on the operator panel connected 15 required in the programmable controller for connecting SIMATIC OP to SIMATIC S5 The following operator panels OP can be used with S5 TD17 OP5 AI1 OP7 PP OP7 DP 12 OP15 x1 OP17 PP OP17 DP 12 OP25 OP35 OP37 TP37 When connecting SIMATIC OP to SIMATIC S7 M7 a distin
91. gt Generate Source File The blocks can be selected in a dialog box after you have entered the name of the source file When creating a sequence of blocks remember to take the call hierarchy into account As a rule called blocks must already exist This means that they must be entered in the source file in front of the blocks from which they are called Result The source file generated contains the instructions with symbolic addressing 3 Now you can carry out the rewiring in the symbol table Replace the changed 55 addresses with the new S7 addresses 4 Once the source file is compiled the blocks contain the new addresses 7 2 Non Convertible Functions Addresses and instructions that cannot be converted automatically are only included as comments in the generated 57 program These you must revise yourself As the user there are two ways in which you can convert these instructions e You can define your own 57 STL instruction sequence macros for these instructions if they occur in the user program These can then be used during conversion e You can edit the instruction sequences in the resulting S7 program Which method is better depends on the number of occurrences of such instructions in your user program You can read about non convertible addresses and instructions in Sections 3 11 and 3 12 These sections also contain suggestions for creating non convertible functions in S7 From S5 to S7 Converter Manual A5
92. he CPUs for SIMATIC 57 400 require a backup battery to buffer timers of S7 400 counters and bit memory Retentive Features The CPUs for 87 300 do not require a battery to buffer timers counters or bit of S7 300 without memory Similarly the contents of data blocks can also be retained in the event Backup Battery of a power failure The CPUs for SIMATIC 57 300 have a maintenance free backup that saves those addresses and data which have parameters specifying that they be retained in event of a power failure The size and quantity of the available retentive areas depend on the respective CPU Parameter The size of the data retention areas is set in parameter assignment dialog boxes Assignment for the during hardware configuration with STEP 7 Retentive Feature From S5 to S7 Converter Manual A5E00171227 01 2 7 Hardware 2 2 2 Power Supply Modules PS A selection of power supply modules is available for each programmable logic controller PLC Any 24 volt power source industrial can be used to supply to the CPU in S7 300 The range of modules in S7 contains the following power supplies specifically designed for S7 300 Module Name Output Output Input Current Voltage Voltage PS 307 2A 24 VDC 120 230 VAC PS 307 5A 24 VDC 120 230 VAC PS 307 10 A 24 VDC 120 230 VAC Module Name Output Output Input Current Voltage Voltage PS 407 4A 4 A 5 VDC 120 230 VAC 0 5 A 24 VDC PS 407 10A 10A 5 VDC 120 230
93. hen converting in order to retain the program structure and call hierarchy of the S5 program If you want to use symbolic names in your program instead of absolute addresses you also require the following data to generate the converted assignment list e S5 assignment list lt Name gt ZO SEQ To prepare the conversion proceed as follows 1 Create a current cross reference list for your 55 program using the 5 software 2 Copy your STEP 5 program file the corresponding cross reference list and if necessary the assignment list into a DOS directory From S5 to S7 Converter Manual A5E00171227 01 Optional Requirement Procedure 5 2 Preparing for Conversion 5 2 Checking Addresses It may be necessary to adapt the converted program to the S7 CPU being used To gain an overview of the range of functions of the S7 CPU proceed as follows Determine the S7 CPU that you want to use Find this S7 CPU in the performance specifications tables in Section 2 2 1 and compare the following two specifications Number of addresses Number of blocks iB 2 with the addresses and blocks to be used Open the SIMATIC Manager Select the S7 CPU in the online view of the project structure Use the menu command PLC gt Module Information to open a dialog box which includes among other things the following information In the General tab you can identify the CPU type obtain information on the memory configuration
94. horization V Visualization 2 22 W Warning Converter messages WinCC 2 22 Word logic instructions Work memory CPU 2 6 2 7 From S5 to S7 Converter Manual A5E00171227 01 Index R Register instructions Restart RET_VAL Retentive behavior Retentive data CPU 2 6 Retentivity Return value ofa function 9 3 of a system function 3 22 Rewire Rotate instructions 5 S5 expansion unit S5 handling block S5 standard function blocks S7 blocks creating S7 project creating SB See Sequence block Scratchpad flags 3 33 9 6 SDB See System data block Sequence block SB Set read CPU time SFB See System function block SFC See System function Shift instructions Shift register Signal functions Signal modules 2 Signal preprocessing ZB dues 2 D 13 SIMATIC Manag er 3 3 window 3 13 SIMATIC S7 overview Simulator module SINEC H1 SINEC L1 2 11 3 26 SINEC L2 2 11 3 26 SM modules 2 15 Software overview of components Source file STEP 7 object Special functions Special OBs Standard functions Standard library Start information 3 34 9 8 Startup 3 20 Index 4 Siemens AG A amp D AS SM ID Ostliche Rheinbriickenstr 50 D 76181 Karlsruhe Federal Republic of Germany From Your Name Your Title Company Name Street City Zip Code Country Phone Pharmaceutica
95. ic Function Block Diagram SCL Manuals GRAPH HiGraph CFC Manuals 1 Optional package for system software for S7 300 S7 400 From S5 to S7 Converter Manual A5E00171227 01 This manual assumes you have knowledge of S7 programs which you can read about in the Programming Manual 234 You should also be familiar with using the Standard software as described in the User Manual 231 The manual is divided according to the following topic areas e Part Chapters to 3 explains how to plan your conversion from S5 to S7 e Part 2 Chapters 4 lo 9 explains how to convert programs with the converter Chapter 9 contains application examples e The Appendix is a reference section on all STL instructions international and German mnemonics provided for reference purposes e The Glossary explains important terms e The Index will help you to locate text passages on important subjects quickly and easily References to other manuals are shown using the part number of the literature between slashes Using these numbers you can find out the exact title of the manual from the literature list at the end of this manual If you have any questions regarding the software described in this manual and cannot find an answer here or in the online help please contact the Siemens representative in your area You will find a list of addresses in the Appendix of 70 or 100 or in catalogs and in Co
96. ing to IEC 1131 3 available to users of SIMATIC 57 elementary and complex data types Complex data types are defined by the user with the data type declaration They do not have their own name and cannot be used more than once A distinction is made between arrays and structures The data types String and Date and Time also belong to this category Elementary data types are predefined data types according to IEC 1131 3 for example the data type BOOL defines a binary variable bit the data type INT defines a 16 bit fixed point variable integer The local data of a logic block are declared in the declaration section if the program is generated using a text editor From S5 to S7 Converter Manual A5E00171227 01 Glossary C Compiler Configuring D Data Block DB Data Static Data Temporary Data Type Data Type Complex Data Type Elementary Declaration Section Glossary 2 Glossary A formal parameter is a token value for the actual parameter of logic blocks which can be assigned parameters The formal parameters are declared by the user in the case of function blocks and functions but are already present in the case of system function blocks and system functions When calling the block an actual parameter is assigned to the formal parameter so that the called block works with its current value The formal parameters are included amongst the local data of the block and are divided into
97. int to the corresponding actual parameter Block parameters of function blocks FB are stored like the static local data in the instance data block Static local data can be used in every function block They are defined in the declaration section and stored in the instance data block Static local data like data addresses in shared data blocks retain their value until they are overwritten by the program Generally the static local data are only processed in the function block However since they are stored in a data block the local data can be accessed in the user program at any time as is the case with variables in a shared data block Scratchpad flags in STEP 5 In STEP 5 bit memory address areas are used to store data temporarily within blocks By common agreement the flags 200 to 250 are reserved for temporary storage The management of scratchpad flags is completely up to the user Temporary local data in STEP 7 Temporary local data are storage areas for data that are only valid during block processing As soon as the block has been processed these local data release the used memory again Each priority class has its own local data stack This prevents intermediate results from being inadvertently overwritten by interrupt programs Local Data in STEP 7 Block Parameters Static Local Data Temporary Local Data From S5 to S7 Converter Manual 3 33 A5E00171227 01 Software In STEP 7 temporary variable
98. ion 3 13 4 From S5 to S7 Converter Manual A5E00171227 01 Timers and Counters Blocks Addresses Indirect Addressing via the BR Register Other Types of Indirect Addressing 7 4 Editing the Converted Program 7 4 Working with Direct Memory Access In STEP 5 access to absolute memory addresses was used for some functions This type of access no longer exists in STEP 7 STEP 5 STEP 7 Addressing data addresses in extra long data Addressing data addresses greater than 255 can blocks now be done with standard instructions L T Indirect addressing with the BR register Indirect addressing can be done with register indirect addressing see Section 3 13 4 and the Statement List Programming Manual 232 Using block transfers For block transfers there is now a system function SFC20 BLKMOV The memory areas to be copied are specified at the block parameters If the memory areas are variable then they can be specified at the parameters ANY pointer which can be accessed in the user program 7 5 Assigning Parameters 55 Command Depending on the type of block transferred the statement B lt Formal B lt Block Parameters of Type B gt runs in S5 as the following Parameters gt e JU Logic Block or as e A DB Data Block In this case automatic conversion is not possible because of missing type information in the formal parameter Check your program for X instructions with p
99. l Plastic Pulp and Paper Textiles Transportation UUUO QO Please check any industry that applies to you Automotive Chemical Electrical Machinery Food Instrument and Control Nonelectrical Machinery UHUuUUOHOO YD Petrochemical From S5 to S7 Converter Manual A5E00171227 01 Os O e 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 IL V LEN E n Please rate the quality of the graphics tables Additional comments From S5 to S7 Converter Manual 2 A5E00171227 01
100. l is made to a function FC which transfers a parameter with a complex data type such as STRING DATE_AND_TIME ARRAY STRUCT or UDT the contents of the DB register for the calling block are overwritten After you have assigned an actual parameter to an FC stored in a DB such as DB100 DBX0 1 STEP 7 opens the DB DB100 in which the contents of the DB register are overwritten After an FB has addressed an in out parameter with a complex data type such as STRING DATE_AND_TIME ARRAY STRUCT or UDT STEP 7 uses the DB register to access data This step overwrites the contents of the DB register After an FC has addressed a parameter input output or in out with a complex data type such as STRING DATE_AND_TIME ARRAY STRUCT or UDT STEP 7 uses the DB register to access data This step overwrites the contents of the DB register From S5 to S7 Converter Manual A5E00171227 01 Software Dangers of Partial Addressing 3 42 Software 3 13 4 Indirect Addressing Indirect addressing using the DO function of S5 has been replaced in S7 by the new indirect memory and register addressing commands Pointer Format in In 55 the pointer for the indicated processing operation occupies one word STEP 5 The structure of the pointer is depicted in Figure 3 7 Byte address 8 T Word address Block number Figure 3 7 Structure Pointer S5 Pointer Format in In S7 there are two possible pointer for
101. lot oriented Module parameters are assigned with the STEP 7 application for configuring hardware CPU parameters are assigned with the STEP 7 application for configuring hardware Compiled configuration data are downloaded to the CPU Module parameters are transferred automatically on startup 2 5 SIMATIC S5 Addresses are set with DIL switches System behavior is set with DIL switches CPU parameters for operational behavior are assigned via system data areas or DB1 0 Comparison of Module Parameter Assignment in S5 and S7 From 55 to S7 Converter Manual A5E00171227 01 Hardware 2 2 1 Central Processing Units CPU 7 300 CPUs Table 2 1 lists the most important performance specifications for S7 300 CPUs If you want to replace an 55 CPU you can use the following table to compare performance in order to select the most suitable CPU Table 2 1 Performance Features of the S7 300 CPUs CPU 312 IFM CPU 313 CPU 314 CPU 314 IFM CPU 315 ae 2 DP m memory 6 Kbytes 12 Kbytes 24 Kbytes 24 Kbytes 48 Kbytes integrated Load memory e integrated 20 Kbytes RAM 20 Kbytes 40 Kbytes 40 Kbytes RAM 80 Kbytes RAM 20 Kbytes RAM RAM 40 Kbytes EEPROM EEPROM e expandable with up to 2 up to 512 up to 512 Kbytes memory card Kbytes Kbytes in CPU programmable up to 256 Kbytes Process image size 32 bytes 128 bytes 128 bytes 124 bytes 128 bytes inputs and outputs
102. mats word and double word STEP 7 15 Ot Le nnnn nnnn nnnn nnnn Bits 0 to 15 nnnn nnnn nnnn nnnn Number area 0 to 65 535 of a timer T a counter C data block DB function FC or function block FB Figure 3 8 Pointer in Word Format for Memory Indirect Addressing 31 24 23 16 15 8 0 a000 Orrr 0000 0 bbb bbbb bbbb bbbb b xxx Bit 31 0 a means area internal addressing Bit 31 1 a means area crossing addressing Bit 24 25 26 rrr Area ID for area crossing addressing Bits 3 to 18 bbbb bbbb bbbb bbbb Number area 0 to 65 535 of the addressed byte Bits 0 to 2 xxx Number area 0 to 7 of the addressed bit Figure 3 9 Pointer in Double Word Format for Memory Indirect and Register Indirect Addressing From S5 to S7 Converter Manual A5E00171227 01 3 43 Memory indirect addressing corresponds to indirect addressing in 55 During memory indirect addressing the address specifies the address of the value that will process the instruction The address consists of the following parts e An address identifier such as IB for input byte and e A word that contains the number of a timer T a counter C a data block DB a function FC or a function block FB or e A double word that specifies the exact address of a value within the memory area indicated by the address identifier The address uses the pointer to indirectly indicate the address of the value or
103. miliar with the name SIMATIC as the synonym for SIEMENS programmable controllers of the S5 family Now the name SIMATIC stands for fully integrated automation The concept fully integrated automation describes a revolutionary new way of combining the worlds of manufacturing and process engineering All hardware and software components are integrated into one single system SIMATIC This complete integration is made possible by the universal compatibility offered by the S7 system in the following three areas e Database Data are only entered once and are then available to a whole factory Transfer errors and inconsistencies are therefore a thing of the past e Configuring and programming All the components and systems belonging to a task are planned configured programmed commissioned debugged and monitored with one single fully integrated software package with a modular design under one user interface and with the most suitable utility e Communication Who communicates with whom is determined simply in a connection table and can be changed at any time The various network types can be configured easily and uniformly To be able to meet the wide range of possibilities of SIMATIC as a fully integrated system brand new concepts have been shaped in SIMATIC S7 Some functions are therefore achieved in other ways to those you are familiar with in S5 The STEP 7 programming software is based on new technology and concepts Fo
104. mming device e SIMATIC S5 e Other stations meaning non SIMATIC S7 M7 and SIMATIC S5 The stations PC programming device SIMATIC 65 and other stations are only listed for configuring communication links Configuration and programming of S5 stations is not possible Click on the sign in front of the project icon in the project window if the station is not displayed below it Prerequisite Inserting a Station From S5 to S7 Converter Manual 3 9 A5E00171227 01 To configure the hardware proceed as follows Click the new station you have inserted it contains the Hardware object Open the Hardware object The HWConfig window is displayed In the Hardware Configuration window plan the structure of the station A catalog of modules is available to help you do this If this is not already displayed select the menu command View Catalog to view it Insert a rack from the module catalog in the empty window Then select the modules and place them in the rack slots At least one CPU must be configured for each station During this procedure HWConfig automatically checks all entries you make l 2 3 For further information on configuring hardware see the User Manual 231 For each CPU you create in your configuration an S7 program and a connection table Connections object are created automatically once you have saved and exited the hardware configuration The S7 program contain
105. mplemented using your S7 CPU If individual instructions cannot be converted a message 15 output indicating the corresponding program sections and the instructions must be reprogrammed manually Do the S5 standard function blocks called in the program to be converted also exist as functions in S7 The S7 Standard software supplied includes the standard software packages already converted for basic functions floating point math integrated functions signal functions and math functions Can integrated special functions used in S5 programs be replaced From S5 to S7 Converter Manual A5E00171227 01 Functionality of the Modules see Chapter 2 System Settings see Section 3 8 Range of Instructions see Section 3 12 Standard Software see Section 3 9 Special Functions see Table 3 5 4 2 Procedure Which Parts of In general not all the parts of a program can be converted Considering the Your Program following points will help you decide whether to convert your S5 program or Should be to recreate it in S7 Programs only containing digital and binary logic operations do not need to be revised Absolute addresses cannot be addressed in S7 The corresponding instructions such as LIR TIR etc are not converted If a program frequently works with absolute addresses it is a good idea to rewrite these parts of the program or if necessary the entire program Processing functions such as DO FW DO DW are pa
106. mpuserve go autforum You can also speak to our Hotline under the following phone or fax number Tel 49 911 895 7000 Fax 7001 If you have any questions or comments on this manual please fill out the remarks form at the end of the manual and return it to the address shown on the form We would be grateful if you could also take the time to answer the five questions giving your personal opinion of the manual Siemens also offers a number of training courses to introduce you to the SIMATIC 57 automation system Please contact your regional training center or the central training center in Nuremberg Germany for details D 90327 Nuremberg Tel 49 911 895 3154 This manual replaces the older Converting S5 Programs User Manual In other manuals this manual may still be referred to under its old name or simply as the Converter Manual From S5 to S7 Converter Manual A5E00171227 01 Preface Structure of the Manual Conventions Additional Assistance Notes vi Contents 1 02 2 22 60 0 a E eee 2 HardWare 2 00 0 00 E ENE 2 1 Programmable Logic Controllers ccc eens 2 2 S7 Modules 0 2 2 1 Central Processing Units 001 eee 2 2 2 Power Supply Modules PS 0 ccc eee een ees 2 2 3 Interface Modules IM 7 2 2 4 Communications Processors 777 7 2 2 5 Function Modules FM 2 2 6 Signal Modules SM 2 2 7 Simulation Modules 87 300
107. must reserve an area in the local stack for temporary local data use since the L stack is being used by the LAD STL FBD editor The absolute addresses of the local data can be read in the block located in the declaration section The local data bits are linked to each other by logic operations in the program This produces the output signals which are written back at the end of the block to the output byte from the local data The addresses for the input and output bytes can be assigned parameters Note Inserting new variables in front of existing local data will cause the subsequent local data addresses to be shifted Table 9 3 Assignment of Inputs Outputs and Local Data Address Local Data Name Description In 0 L 0 0 ON ON switch I n 1 L 0 1 STOP Stop motor I n 2 L 0 2 EMERGENCY_STOP Emergency stop button I n 3 L 0 3 MOTOR RIGHT Motor clockwise on I n 4 L 0 4 MOTOR LEFT Motor counter clockwise on I n 5 L 0 5 LIMIT SWITCH RIGHT Limit switch right I n 6 L 0 6 LIMIT SWITCH LEFT Limit switch left I n 7 L 0 7 Free Q m 0 L 1 0 READY Motor is ready Q m 1 L 1 1 CLOCKWISE Clockwise active Q m 2 L 1 2 COUNTER CLOCKWISE Counter clockwise active Q m 3 L 1 3 POSITION REACHED Position reached Operation The voltage is applied via the ON switch The motor is now ready for use this status is signaled by the output READY The motor can be operated in a clockwise or counter clockwise direction as required by using the buttons MOTOR RIGHT and
108. n blocks From S5 to S7 Converter Manual A5E00171227 01 Glossary Instruction Local Data Logic Block Macro O Online Help Organization Block OB Glossary 4 Glossary A pointer is a variable which does not possess a particular value but the address of another variable With pointer instructions the type on the right side of the operator must correspond to the type on the left side A programming language is used to create user programs and provides a specific vocabulary for this purpose in the form of text instructions or graphic elements These instructions are entered by the user using an editor and compiled into an executable user program A project is a container for all objects in an automation task independent of the number of stations modules and how they are connected in a network Data are called retentive if they have the same value after a power supply failure as before the power supply failed The data are backed up in two ways e Voltage backup e Backup memory An S7 program is a container for blocks source files and charts for S7 programmable modules which also contains the symbol table Shared data are data which can be accessed from any logic block function FC function block FB organization block OB These are bit memory M inputs D outputs Q timers T counters C and elements of data blocks DB You can access shared data either absolutely or symbolically
109. nce data block is associated with this call An instance data block stores the formal parameters and static data for function blocks An instance data block can be associated with a function block call or a call hierarchy of function blocks Formal Parameter Function FC Function Block FB I O Distributed DP Instance Instance Data Block From S5 to S7 Converter Manual Glossary 3 A5E00171227 01 An instruction is part of a STEP 7 statement and specifies what the processor should do Local data are data assigned to a logic block which are declared in its declaration section or its variable declaration They cover depending on the block formal parameters static data temporary data In SIMATIC 57 a logic block is a block that contains part of the STEP 7 user program The other type of block is a data block which contains only data The following list shows the types of logic blocks e Organization block OB e Function block FB e Function FC e System function block SFB e System function SFC A macro 15 a sequence of instructions which are combined into a mnemonic call optimized for execution STEP 7 enables you to display context sensitive help on the screen while you are working with the programming software Organization blocks form the interface between the CPU operating system and the user program The sequence in which the user program should be processed is laid down in the organizatio
110. ndard library in the SIMATIC Manager with the converted S5 functions StdLib30 3 Copy the required S7 functions from the standard library into the 7 program From S5 to S7 Converter Manual A5E00171227 01 S5 Standard Function Blocks Inserting FCs 7 6 Before you can run the converted and edited program it must be compiled with the STL compiler The procedure is exactly the same as for compiling a newly written text file Select the the menu command File Consistency Check to check the syntax and consistency of the source file at any time without causing blocks to be generated Among other things this function checks the following e The syntax e The symbols and e For the presence of called blocks in the program Once the check is complete a compiler report is generated which contains the name of the compiled file the number of lines compiled the number of errors present as well as any warnings that occurred Select the menu command File gt Compile to convert your source file into a block Once the compiling is complete a compiler report is displayed containing any errors that occurred This report is similar to the one displayed after a file has been checked for consistency If a source file contains several blocks then only the error free ones are compiled and saved Compiling the Program Checking Data Consistency Compiling the Source File From S5 to S7 Converter Manual 8 1 A5E00171227 01
111. o You may have to use the specified replaced by the instruction 7 in this form instruction PL P formal parameter Jump label cannot be 2nd run JUR instruction exceeds block Correct the error in the S5 program generated limit Label invalid Istrun Jump label contains invalid Check the S5 file characters Label undefined Istrun Jump label not defined in the Check the S5 file preheader Memory overflow in Istrun Not enough main memory Delete files you no longer require programming device space in the main memory problem No access rights general File is read only Clear the read only attribute No block name given Istrun Block name consists of only Enter a block name blanks Undefined command Istrun Invalid MCS STL instruction Correct the S5 program file 2ndrun Instruction does not exist in 7 Edit a macro or replace the instruction with the appropriate 7 instruction sequence Undefined formal parameter Istrun More parameters than in calling Check the S5 program file block Write error on diskette general File is read only or there is no Clear the read only attribute or space on the diskette delete unnecessary data Wrong address Istrun Address does not match instruction Check the S5 source file 2nd run Address does not match instruction Modify the STL file Wrong comment length Istrun Error in 55 file Check the program file Wrong nesting depth Istrun End of bracketed expression Check the nesting levels correct incorrect the pr
112. objects and documents via OLE2 0 and OLE Custom Controls OCX are also included These mechanisms make WinCC an effective communication partner for Windows applications WinCC is based on the 32 bit operating systems MS Windows 95 or MS Windows NT Both feature preemptive multitasking which ensures quick reaction to process events and provides a high level of security against data loss Windows NT provides additional security functions and can also serve as the basis for server operation in a WinCC multi terminal system The WinCC software is itself a 32 bit application which was developed using the most modern object oriented software technology From S5 to S7 Converter Manual A5E00171227 01 WinCC 2 22 Software 3 1 General Operating Principles Overview The software for configuring and programming SIMATIC S7 M7 C7 is designed according to modern ergonomic concepts and is thus largely self explanatory 3 1 1 Installation Requirements Operating System Microsoft Windows 95 Standard Hardware Programming device or PC with the following specifications and equipment e A 80486 processor or higher e A minimum 16 Mbytes RAM 32 Mbytes recommended e A VGA monitor or other type of monitor supported by Windows 95 e A keyboard and optional but recommended a mouse supported by Microsoft Windows 95 Storage Capacity The following storage space is required on the hard disk e The Standard package with one language inst
113. oceed as follows 1 Open the S7 program 2 Open the Symbols object in the S7 program and define the symbols This step can also be done later You will find more information on defining symbols in Section 3 13 2 Open the Blocks container if you want to create blocks or open the Source Files container if you want to create a source file Insert a block or a source file as appropriate For detailed information see Section 3 6 2 The following menu commands are used for this Insert gt S7 Software gt Block or Insert gt S7 Software gt Source File Open the block or source file and enter a program You will find more information on programs in the Programming Manuals 232 236 Depending on your task you may not need to perform all these steps S7 S7 Program Container for all data in a program 4L Container for blocks Compile Blocks Generate source file Soflware Procedure Container for source files Program in source file form Figure 3 5 Basic Objects in a STEP 7 Project and Their Hierarchical Structure From S5 to S7 Converter Manual A5E00171227 01 3 14 Software 3 6 2 Inserting Components for Creating Software in S7 and M7 An S7 M7 program is created automatically for each programmable module as a con
114. ogramming error Wrong number of parameters 18 Error in the 55 program Check the program file Wrong parameter type Istrun Error in the S5 program Check the program file Error Messages Meaning and Remedy Table 6 1 From S5 to S7 Converter Manual A5E00171227 01 Conversion Warnings Warnings are displayed if parts of the 55 program are converted but should be checked once more Table 6 2 Warnings Meaning and Remedy Warning Source Meaning Remedy ID only influences Accu 1 1 2ndrun 57 accumulators extended to Check the consequences of an now whole Accu 1 32 bits indirect INCREMENT DECREMENT instruction in the STL program If S5 115U then change to 2nd run The startup OB21 in S5 is If the S5 program ran on an OB 100 automatically converted to OB101 S5 115U you have to change OB101 to OB100 Jump instruction after EDIT 2nd run An EDIT instruction with JU Replace the instruction in the STL cannot be compiled cannot be converted automatically file by JL and check the jump Note block numbers may be 2nd run An indirect block call does not Change the logic in S5 or use fixed changed take into account new block block calls numbers number is fetched from corresponding memory word or data word OB 23 and OB 24 have been 2nd run OB 23 and OB 24 are both Put the contents of OBs 23 and 24 converted to OB 122 replaced by OB 122 in S7 into OB
115. onal LG lt gt eG eG eG GFD CEFW CSD CSW 0 O OW STP STS STW TAK A AW XOW y 99 sk ok 9 S5 STL International 2 ADD BF ADD DH ADD KF CX DO Address and Instruction Lists Table A 3 S5 STL German I G lt gt GG eG ec GFD KEW KZD KZW 0 O OW Sp STS STW TAK U UW XOW y 99 sk ok 9 Conversion Instructions with Addresses Table A 4 S5 STL German A ADD BF ADD DH ADD KF RAN B A 4 Address and Instruction Lists Convertible Instructions with Addresses continued S7 STL International 9999 IC DEC CALL SFC22 CALL SFC22 ER INC y LC NOP Q ON SET A SET AN R RLW PRRD URRW SET R 2S7 SP SP C p SD Sp SLD USEW TU IC IM UJCN IO Jp Timer Counter S7 STL German SPB DEC CALL SFC22 CALL SFC22 ER INC p Lc NOP 0 ON SET U SET UN R R R RLW RRD URRW SET R S SA NUNC PZR SE SI SLD USEW SPA SPB SPM SPO
116. ons Connection Table Edit Insert PLC View X Help S s lt ml x Station Module SIMATIC 400 Station 1 Y CPU 413 1 1 Y Local ID Partner ID Active Send Operating Mode a hex hex ss Wigs Connection Setup Messages 1000 SIMATIC S5 1 S7 PtP Connection Yes No Figure 3 3 Connection Table From 55 to S7 Converter Manual 3 12 A5E00171227 01 Software 3 6 Inserting and Editing a Program The procedure described in this section applies to creating a new program 3 6 1 Basic Procedure for Creating Software Overview The software for CPUs is stored in program containers In SIMATIC S7 modules such an object is called an S7 Program The figure below shows an S7 program in the CPU of a SIMATIC 300 station KA SIMATIC Manager zebra Pol EE a3 hel zebra Standard Hierarchy Offline Project C SIEMENS STEP7 S7p BEJ zebra D Source Files SIMATIC 400 Station x Symbols SIMATIC 400 Station Blocks CPU 314 1 A IE fO Source Files 3 Blocks sz S7 Program 1 Figure 3 4 Open 57 Program in the SIMATIC Manager From S5 to S7 Converter Manual A5E00171227 01 3 13 To create the software for your project pr
117. onverting S5 Files Test2 ST S5D Dialog Box If required you can modify the names of the target files STL File Error File and Converted Assignment List proposed by the software This may be necessary if the editor with which you want to process the converted files requires certain name conventions for example TEST TXT To change the name of a file proceed as follows Click the text box with the path name of the target file you want to modify 2 Modify the text as required The software proposes new numbers for the blocks to be converted and displays them in the dialog box Converting S5 Files Test2 ST S5D If you want to assign different numbers proceed as follows 1 Double click the block number you want to modify 2 Enter the new number in the New Block Number dialog box and click the OK button to confirm your entry From S5 to S7 Converter Manual A5E00171227 01 Conversion Selecting a Program File Changing the Target File Names Assignment No gt New No 6 2 Conversion If your S5 program contains standard function blocks SFBs these are marked by an asterisk in the Std column By clicking on the Start button you start the conversion The conversion consists of two conversion runs and the conversion of the assignment list In the first conversion run the S5 program is converted into an S5 source file with all blocks and comment
118. ork memory CRC 3 23 Creating software 3 13 inserting components 3 15 Cross reference list Cycle monitoring time 3 23 50 Cyclic interrupt D Data block DB 3 17 3 18 Data block instructions 3 36 DB See Data block DB register 3 41 3 42 DBI 0 Diagnostic buffer Diagnostic interrupt 2 15 9 2 DIL switches Distributed I O DP master modules DP slave modules DX See Data block DX0 3 26 E Edge change Error handling 3 21 Index 2 Index N Network STEP 7 object Non convertible address instruction Null instructions O OB See Organization block OB macro OBI example Operator control and monitoring Operator Panel OP Organization block OB 3 17 d 20 Outputs analog digital P Page commands 3 38 PB See Program block Performance PG interface Point to point connection interface in user pro E T modules 2 12 Pointer format Position detection modules Positioning module Power supply modules Process image CPU Processing functions DO FW DO DW PROFIBUS 2 3 2 10 2 18 interface in user program modules 2 11 Program block PB 3 17 Programmable controllers overview Programmable modules Programming device interface AS511 2 3 MPI 2 3 Project creating Project file Proportioning module ProTool 2 22
119. ource field into another memory area the target field You can use SFC20 BLKMOV to copy all inputs outputs bit memory and Description Indicates the memory area to be copied source field If an error occurs during processing of the function the return value will contain an error code Indicates the memory area into which the data is to be copied target field Memory Area I Q M D L I Q M D L I Q M D L Data Type ANY INT ANY data Declaration INPUT OUTPUT OUTPUT Note The source and target fields must not overlap If the target field specified is larger than the source field than only the amount of data contained in the source field is copied into the target field If the target field specified is smaller that the source field then only the amount of data that the target field can accept is copied If you want to have the parameters for the source and target areas of SFC20 BLKMOV filled with variable values instead of constant pointers you can do this by using temporary variables of the data type ANY 9 11 9 4 Parameters Parameter SRCBLK RET_VAL DSTBLK From S5 to S7 Converter Manual A5E00171227 01 The following tables show the structure of the ANY pointer see Figure 9 7 SSTIME Byte n 9 0 Application Example Structure of the ANY Pointer for Data Types ANY Pointer Byt
120. plete the S7 Insert the required software containers S7 Program containers required for creating software Programs in your project are already inserted and available see Section 3 6 Then create the software for the programmable Then create the software for the programmable modules modules see Section 3 6 see Section 3 6 Configure your hardware ee configured the hardware The procedure for downloading and testing your program without a hardware configuration is described in the User Manual 231 From S5 to S7 Converter Manual A5E00171227 01 3 Software Storing Projects To back up a project you can save a copy of the project under another name or archive it To save the project under another name proceed as follows 1 Open the project 2 Select the menu command File gt Save As The Save As dialog box is displayed 3 Select either save with or without a consistency check and close the dialog box with OK The Save As dialog box is displayed 4 Under Save In select the directory in which the project is to be saved 5 In the File Name field enter a file name in place of the asterisk Do not change the file extension 6 Close the dialog box with OK Make sure that there is enough memory available on the drive selected For example it is not advisable to select a disk drive to back up a project because a project is generally too large to fit on a disk
121. positive and a 1 for a negative value In S7 there are no error bits If an error occurs the value W 16 7FFF is output In the case of an error blocks having diagnostic capability can trigger a diagnostic interrupt The parameters for this interrupt are set in HWConfig From S5 to S7 Converter Manual A5E00171227 01 15 5 Analog Value Representation in S7 Table 9 2 Resolution Bit Number Bit Value 9 2 Application Example If the resolution of an analog module is less than 15 bits the analog value is left aligned in the user data Unoccupied low values have the signal state 0 In this example the speed of the motor is read by an analog input module having a resolution of 14 bits This measured value has a bipolar range such as H 10V Upper and lower limits are transferred as parameters The analog value is checked for an upper and lower limit If the value read lies outside of the permissible range an error is reported using the binary result BR 0 and output as the value 0 If the value is acceptable it is output The analog value is output via the return value RET VAL of the function This RET VAL is a functional value In 57 this is a new functionality compared to S5 Example From S5 to S7 Converter Manual 9 3 A5E00171227 01 Application Example FUNCTION FC1 REAL TITLE Analog Value Processing NAME ANALOG VERSION 01 00 VAR_INPUT INPUT
122. pplication uses this system data to create a rack configuration and a signal list You can then convert this 55 configuration to an S7 configuration Hardware Converting Hardware from 5 to S7 using the Siemens Catalog on CD ROM From S5 to S7 Converter Manual 2 1 A5E00171227 01 Hardware 2 1 Programmable Logic Controllers SIMATIC S7 consists of the following three types of programmable logic controllers classified according to their performance range SIMATIC S7 200 SIMATIC 57 200 is a compact micro programmable logic controller PLC designed for applications having the lowest performance range S7 200 is controlled by its own system specific software package which is not included in the following comparison of S5 and 7 SIMATIC S7 300 SIMATIC 57 300 is a modular mini controller designed for applications having a low performance range SIMATIC S7 400 SIMATIC 57 400 is designed for applications providing an intermediate to high performance range For easy reference S7 300 module names always start with a 3 and 57 400 module names with a I High 55 1350 SIMATIC performance range S7 400 S5 155U CPU 944 945 modular 95 115U I MM Intermediate CPU S7 300 performance range 941 943 S5 95U i i modular Lower 55 90 P S5 100U performance range SIMATIC S7 200 compact Figure 2 1 SIMATIC Programmable Controllers From S5 to S7 Convert
123. r Manual A5E00171227 01 9 1 Analog Value Processing The analog values are only processed in digital form by the CPU Analog input modules convert the analog processing signal into digital form Analog output modules convert the digital output value into an analog signal Application Example 9 1 Conversion of Analog Values Analog Value Representation in S5 Table 9 1 Example of the Analog Input Module 6ES5 460 71 13 Resolution Analog Value Bit Number 15 14 13 12 id 10 9 8 7 6 5 4 3 2 1 0 Bit Value PS 211 210 29 28 27 26 25 24 23 22 21 20 A E O The values for analog output modules are depicted as 12 bit twos complement Analog input modules can evaluate the value as a signed 12 bit number or as a 13 bit twos complement as required The O bit indicates the amount of overflow The E bit is the error bit which is set when an error occurs for example a wire break if thius has been assigned parameters The A bit corresponds to the activity bit If the bit is 0 then the value displayed 18 For the same nominal range the digitalized analog value is the same for input and output values Analog values are represented as a twos complement Example of Analog Input Modules in S7 Analog Value 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 214 213 212 21 210 29 28 21 26 25 24 23 22 21 20 The sign preceding S sign the analog value is always in bit 15 here a 0 stands for a
124. r example the user interface is designed to meet modern ergonomic requirements and runs under Windows 95 NT In our programming languages we have endeavored to adhere to the IEC 1131 standard as closely as possible without becoming incompatible with STEP 5 From S5 to S7 Converter Manual A5E00171227 01 1 1 We are convinced that our new STEP 7 system meets the following demands e A software basis for fully integrated automation e Programming which conforms to IEC 1131 e Compatibility with STEP 5 We are also aware that converting from an existing system to a new system gives rise to a number of questions and we recognize that it will be necessary to make certain adaptations particularly with regard to the software This manual is intended to provide answers to these questions and at the same time show you simple ways in which you can continue to use your existing STEP 5 programs in SIMATIC 57 From S5 to S7 Converter Manual A5E00171227 01 1 2 This chapter describes the hardware that can be used for 57 and makes comparisons when necessary with the hardware used for S5 in order to facilitate the transition from S5 to S7 The Siemens CD ROM Components for Automation catalog CAOI from 4 97 contains an application designed to aid you in choosing hardware when converting from S5 to S7 To access the catalog of products select the menu command Auswahlhilfen gt Simatic Here you can enter any 55 system desired the a
125. rary which must be loaded to the converted file before compiling Loadable FCs contained in the FBlibl library which must be loaded to the converted file before compiling FC blocks without parameters sequencers cannot be converted and must be created in S7 GRAPH Shared data blocks DBs Shared data blocks DBs If the blocks contain CPU specific entries the parameter settings must be made with STEP 7 The converted contents of DB1 and DXO are irrelevant and can be 3 25 deleted Block Types in 55 and 7 SS User program Special function User program User program Integrated function blocks Standard function blocks User program User data User data Data blocks with system settings Fixed numbers Fixed numbers 0 to 255 0 to 255 Fixed numbers Fixed names 0 to 255 2 to 255 to 255 Table 3 6 OB OB PB FB FX FB FB FX SB DB DX DB1 DXO From 55 to S7 Converter Manual A5E00171227 01 Software 3 8 System Settings Converting DB1 The following tables show how the functions for the parameters in DB1 and and 0 DXO system settings are made Table 3 7 Converting the System Settings from DB1 S5 Parameter Block How Implemented in S7 Startup delay Call SFC47 WAIT IPC flags Set using global data communication call SFC60 GD_SND SFC61 GD RCV System enters error messages in the diagnostic buffer
126. rtially converted however in this case you can save memory by reprogramming the functions in 57 This functionality can be obtained with indirect addressing The parameter values of block calls must be always be checked and adapted since the actual parameters used are transferred during conversion without being changed 4 3 Reprogrammed in S7 From 55 to S7 Converter Manual A5E00171227 01 Procedure 4 2 Creating an S7 Project STEP 7 provides you with the following two options for creating a project The STEP 7 wizard helps you create a STEP 7 program quickly with the CPU you want to use After completing this step you can start programming In addition you have the option of creating your project manually The procedure for this is described in Section 3 3 1 Creating a Project with the STEP 7 Wizard Creating a Program Manually 4 3 Defining Hardware At this point it is a good idea to configure the hardware since data are determined in HWConfig that can be then be used to prepare for conversion However if you do not want to configure your hardware yet you can still do it later The information found in Chapter 2 Hardware will help you select the S7 or S5 modules required for your configuration and fill out the hardware configuration table see Section 3 4 The address allocation for the modules is done automatically by HW Config This means that you can already use the addresses during conversion
127. s Convert File Status strun Files STEP 5 File DA TEST ST S5D Block SB 39 Statistics Total Block Lines 750 389 Warnings 12 Errors 0 6 0 Cancel Figure 6 3 First Conversion Run In the second run the S5 source file is converted to the STL source file with the new block types block numbers and S7 syntax S5 Standard Function Blocks Starting the Conversion From S5 to S7 Converter Manual A5E00171227 01 Conversion Converting the The symbols in the S5 assignment list are converted into a form which can be Assignment List imported by the Symbol Editor Convert File Figure 6 4 Converting the Assignment List From S5 to S7 Converter Manual 6 4 A5E00171227 01 Conversion 6 2 Generated Files During conversion the S5 S7 convertor generates the following files The file lt Name gt A0 SEQ This file is generated during the first conversion run It contains the file lt Name gt ST S5D in ASCII form The file lt Name gt AC AWL This file is generated during the second conversion run It contains the STL program Any messages resulting from incorrect macro definitions originate from this run The file lt Name gt S7 SEQ This file is generated from the conversion of the assignment list It contains the converted assignment list in a form suitable for importing with the Symbol Editor The error file lt Name gt AF SEQ This file
128. s the Source Files and Blocks objects as software containers as well as the symbol table The Blocks container contains the object for OBI and the System Data object with the compiled configuration data From S5 to S7 Converter Manual A5E00171227 01 Software Configuring the Hardware Result of Configuration 3 10 Software 3 5 Configuring Connections in the Connection Table In 55 connections are configured with COM NCM There is a COM package for each communications processor CP In S7 all connections are configured in the connection table Configuring connections is a prerequisite for using SFB communication functions in a user program A connection determines the following e The communication partners involved in the S7 project e The type of connection established such as an S7 connection or FDL connection e Special properties such as the active or passive establishment of a connection or whether operating mode messages are to be sent When you configure connections a unique local identifier known as the local ID is issued for each connection This local ID is all you require when assigning communication parameters Each CPU that can serve as the end point of a connection has its own connection table If both communication partners are S7 400 stations a local ID is automatically issued for both end points of the connection Only one local ID is generated on the S7 400 station for conn
129. s are used for the following three applications e As intermediate storage for data from a user program This application is explained above and applies to functions FCs function blocks FBs and organization blocks OBs e As memory used for transferring operating system information to the user program The information supplied by the operating system to the user program has a special name start information This start information is exclusively provided to the organization blocks OBs as an interface between the operating system and the user program e To transfer parameters in FCs You declare temporary local data within a block When you create a new block you declare symbolic names for the temporary variables at the beginning and then use them within the block Each priority class has 256 bytes available in the 57 300 A total of 16 Kbytes are available in the S7 400 which the user can divide among the priority classes when assigning parameters to the CPU From S5 to S7 Converter Manual A5E00171227 01 Using Temporary Local Data in STEP 7 Where Are Temporary Local Data Declared 3 34 Software Instructions The following table provides an overview of the instructions used In addition it also shows which instructions can be converted If the instructions are not convertible then other conversion options are indicated Conversion Option Use address register ARI AR2 Substitute by access to
130. s 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 Automation and Drives Industrial Industrial Automation Systems Postfach 4848 D 90327 Nuernberg Siemens Aktiengesellschaft This manual supports you when converting S5 programs into S7 With the information in this manual you can do the following e Convert existing S5 programs into S7 programs and subsequently edit them manually if necessary e Incorporate pre converted S7 functions previous S5 standard function blocks into your S7 programs This manual is intended for programmers who wish to use existing S5 programs in S7 This manual is valid for release 4 0 of the STEP 7 programming software Preface Purpose of the Manual Audience Where is this Manual Valid From S5 to S7 Converter Manual A5E00171227 01 Preface Where Does this There is a wide range of user documentation available to support you in Manual Fit in with configuring and programming an S7 programmable controller which is the Rest of the S7 intended to be used selectively The following explanations should make it Documentation easier for you to use the user documentation This symbol indicates the order in which you should read the manuals particularly if you are a first time user of S7
131. s the PG 740 are supplied with installable STEP 7 software already on the hard disk For further information on installing STEP 7 see the User Manual 231 From S5 to S7 Converter Manual A5E00171227 01 Overview Authorization 3 2 Software 3 1 3 Starting the STEP 7 Software Starting After starting Windows 95 NT you will find the icon for the SIMATIC Manager on the Windows user interface This is the access point to the STEP 7 software Double clicking the SIMATIC Manager icon is the fastest way to start STEP 7 This icon opens the window for the SIMATIC Manager From here you can access the standard system all optional software and all functions that you have installed Alternatively you can also start the SIMATIC Manager by clicking the Start button in the Windows 95 NT taskbar The menu title for this is found under Simatic STEP 7 SIMATIC Manager The SIMATIC Manager is the initial window used for configuring and programming Here you can do the following e Set up projects e Configure and assign parameters to hardware e Configure communication connections e Create programs e Test programs and start them running Access to functions is object oriented intuitive and easy to learn You can work with the SIMATIC Manager in the following ways e Offline not connected to a controller or e Online connected to a controller When doing this be sure to observe the appropriate safety guidelines
132. sable cyclic timed interrupts individually on off Delay all interrupts on off Delay cyclic timed interrupts individually on off Set read CPU time continued on next page 3 22 Software Replacement in S7 SFC28 SET_TINT SFC30 ACT_TINT SFC31 QRY_TINT Local data in OB1 STEP 7 instruction LOOP SFC47 WAIT Omitted Omitted SFC24 TEST_DB SFC20 BLKMOV SFC20 BLKMOV SFC20 BLKMOV Omitted No page addressing in S7 S7 instruction ITD Parameter assignment with S7 SFC43 RE_TRIGR Multicomputing startup only for same startup type Omitted Omitted Omitted SFC51 RDSYSST SFC6 RD SINFO Communication with SFBs Omitted Omitted Omitted Closed loop control FBs FB41 FB43 or SFB41 3 Omitted 3 23 Table 3 5 Special Functions in 55 and 57 continued Function S5 Block Set read time controlled 1 OB152 OB160 163 S5 135U OB160 S5 115U OB170 OB180 OB181 OB182 OB190 OB192 OB191 OB193 OB200 205 OB216 218 OB220 OB221 OB222 OB223 OB224 OB226 OB227 OB228 OB230 237 OB240 OB241 OB242 OB250 OB251 OB254 OB255 interrupt time Cycle statistics Counter loop Variable timed loop Read block stack Variable data block access Test data block Copy data area Transfer flags to data blocks Transfer data blocks to flag areas Functions for multiprocessor communication Page access Sign extension Se
133. sign on The S7 CPUs have integrated system functions and organization blocks included with their operating system which you can use when programming The manual provides you with an overview of the system functions organization blocks and loadable standard functions available in S7 and in the form of reference information detailed interface descriptions for their use in your user program The STEP 7 User Manual explains the main usage and the functions of the STEP 7 automation software As a first time user of STEP 7 and as an experienced user of STEP 5 this manual will provide you with an overview of the procedures used to configure program and start up an S7 300 S7 400 While you are working with the software you can access a range of online help topics which offer detailed support on using the software You will need the From S5 to S7 Converter Manual if you want to convert existing 5 programs to run them on S7 CPUs The manual provides an overview of the procedures and usage of the Converter you can find a detailed description of the converter functions in the online help You will also find the interface descriptions for the converted S7 functions available in the online help Practical information is also provided on SIMATIC S7 hardware and software The manuals for the programming language packages Statement List Ladder Logic Function Block Diagram and SCL Sequential Control Language contain both the user s guide an
134. sion to ground and to tag circuits equipment and systems in accordance with established safety practices and standards Correct Usage Note the following Warning 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 ZN and operated and maintained as recommended SIMATIC SIMATIC NET and SIMATIC HMI are registered trademarks of SIEMENS AG Trademarks Third parties using for their own purposes any other names in this document which refer to trademarks might infringe upon the rights of the trademark owners Disclaimer of Liability We have checked the contents 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 1997 2002 Subject to change without prior notice Excellence in Automation amp Drives Siemens A A5E00171227 01 Copyright Siemens AG 1997 2002 All rights reserved The reproduction transmission or use of thi
135. t cycle monitoring time Restart cycle monitoring time Compare startup types Transfer IPC flags in blocks Read word from the system program Read CRC of the system program Read status information of a program processing level Functions for handling blocks Initialize shift register Process shift register Delete shift register Control Initialize PID algorithm Control Process PID algorithm Transfer data blocks DB D X to DB RAM From S5 to S7 Converter Manual A5E00171227 01 Software 3 7 6 Block Representation during Conversion Block Assignment The block structure has been changed for S7 The figure below shows a simplified example of a block assignment for STEP 5 and STEP 7 resulting from the conversion process STEP 5 NLS STEP 7 Figure 3 6 Blocks with Comparable Function in STEP 5 and STEP 7 Table 3 6 on the following page shows you how block calls are converted From 55 to S7 Converter Manual 3 24 A5E00171227 01 Software Fixed numbers S7 Corresponding S7 OB Not convertible must be reprogrammed with S7 Number is proposed Number is proposed Fixed numbers Fixed numbers Number is suggested Number taken from S5 Number from 256 onwards is suggested FC blocks without parameters FC blocks with parameters whose names are retained Loadable FCs contained in the FBlibl lib
136. tainer for the software The following objects already exist in a new S7 program gt Symbol table Symbols object e A Blocks container for blocks with OBI as the first block e A Source Files container for programs in the form of source files If you want to create Statement List Function Block Diagram or Ladder Logic programs select the existing Blocks object and then click the menu command Insert S7 Software Block In the submenu you can select the type of block you want to create such as a data block user defined data type UDT function function block organization block or variable table VAT You can now open the empty block and start entering the Statement List Ladder Logic or Function Block Diagram program You will find more information in the Statement List 232 Ladder Logic 233 and Function Block Diagram 236 Programming Manuals The System Data object SDB which may exist in a user program was created by the system You can open it to view its contents but you cannot make changes to it for reasons of consistency It is used to make changes to the configuration once you have loaded a program and to download the changes to the programmable controller You can also use blocks from the standard libraries supplied with the software to create user programs You access the libraries using the menu command File lt Open You will find more information on using standard libraries and cre
137. the symbol table 3 Select the menu command Symbol Table gt Import in the window containing the symbol table A dialog box is displayed 4 Select the symbol table that you want to import in the dialog box and then click the Open button 5 Check over the data records in the symbol table and make any corrections necessary 6 Save and close the symbol table Note A symbol table in SEQ file format that was converted from S5 to S7 can no longer be imported into 55 The file format DIF is recommended for exchanging symbol tables between S5 and S7 For further information on symbol tables see the User Manual 231 From S5 to S7 Converter Manual A5E00171227 01 Software Local Symbols When are Symbols Declared Importing a Symbol Table 3 40 Software 3 13 3 New Feature Complete Addressing of Data Addresses Complete addressing means that the data block is specified along with the data address This was not possible in S5 Complete addressing can occur either absolutely or symbolically Combining absolute and symbolic addressing within one statement is not possible L DB100 DBW6 L DB_MOTOR SPEED DB_MOTOR is the symbol for the data block DB100 and is defined in the symbol table MOTOR SPEED 1s a data address that was declared in the data block This means that the symbolic name for the data address DB_MOTOR SPEED is just as unique as the absolute address DB100 DBW6 Completely addressed data
138. tput module B 16 55 Logical base address of module where the fault occurred Module is defective Internal fault External fault Channel fault External voltage failed Front panel connector not plugged Module is not configured Incorrect parameters on module Bit 0 to 3 Module class Bit 4 Channel information exists Bit 5 User information exists Bit 6 Diag interrupt from substitute Bit 7 Reserve Submodule is missing or has an error Communication problem Operating mode 0 RUN Watchdog timer responded Internal power supply failed Battery dead Entire backup failed Reserved Rack failure Processor failure EPROM fault RAM fault 1 STOP continued DATA BLOCK DB DIAG TITLE Diagnostic Data NAME DB_DIAG VERSION 01 00 STRUCT MDL_ADDR INT NO_EXT_VOLTAGE BOOL DATE_TIME DATE_AND_TIME SFC_RET_VAL INT END_STRUCT BEGIN END_DATA_BLOCK ORGANIZATION BLOCK OB82 TITLE Diagnostic Interrupt NAME Diagnostic VERSION 01 00 VAR TEMP OB82 EV CLASS BYTE JJ y iy OB82_FLT_ID BYTE OB82 PRIORITY BYTE OB82 OB NUMBR BYTE 0282 RESERVED 1 BYTE OB82 IO FLAG BYTE 47 yay 0282 MDL ADDR INT A7 Ef OB82 MDL DEFECT BOOLs 7 OB82_INT_FAULT BOOL OB82_EXT_FAULT BOGU A7 OB82_PNT_INFO BOOL OB82_EXT_VOLTAGE BOOhs 7 OB82 FLD CONNCTR BOOL OB82 NO CONFIG BOOTs 7 OB82 CONFIG ERR BOOL OB82 MDL TYPE BYTE a i E i OB82 SUB MDL ERR BOOL OB82 COMM FAULT BOOL 0582 MDL STOP
139. ts This measured value has a bipolar range such as 10V Upper and lower limits are transferred as parameters The measured value is output via the return value RET_VAL for the function Each function can optionally provide a return value The data type of the return value is indicated in the description of the function If no return value is provided then the position for the data type has the entry VOID FUNCTION FC2 INT TITLE Calculating Measured Value NAME MEASURED VALUE VERSION 01 00 VAR_INPUT INPUT VALUE Input value current value UPPER LIMIT Upper rinit LOWER LIMIT Lower limit END VAR VAR TEMP LOCAL data as intermediate result END VAR BEGIN NETWORK TITLE Calculating Measured Value INPUT VALUE Formula for calculating units 55296 0 Measured value INPUT VALUE 55296 number of units UPPER LIMIT LOWER LIMIT LOCAL Intermediate result in local data UPPER LIMIT Buffer LOWER LIMIT LOCAL Convert floating point number into integer RET_VAL END_FUNCTION Figure 9 3 Calculating Measured Value From 55 to S7 Converter Manual A5E00171227 01 9 5 Application Example Example 2 The second example uses local data which are addressed absolutely such as the S5 scratchpad flags and shows how the clockwise and counter clockwise operation of a motor is controlled In this example the input byte and the output byte are copied into the local data area The user
140. u have installed the STEP 7 software on your programming device Converter start the 55 57 Converter using the Start button in the taskbar of Windows 95 e Click on the entry Simatic STEP 7 Convert S5 files The S5 S7 Converter then displays the following initial screen 5 Converting S5 Files x File Edit View Help aw ee sb vb Press F1 for help Figure 6 1 Initial Screen of the S5 S7 Converter From S5 to S7 Converter Manual A5E00171227 01 6 1 To select a program file proceed as follows 1 Select the menu command File gt Open 2 Select the drive and the directory containing the files to be converted 3 Select the file to be converted and click OK to confirm your selection Result The S5 S7 Converter displays the source and target files and an assignment of the old and new block numbers The figure below shows the dialog box Converting S5 Files lt Test gt ST S5SD converting S5 Files Test st s5d File Edit View X Help ej S5 File D SSCONV S5_PROGR TEST ST S5D XRF File D SSCONV S5_ PROGR TEST R INI STL File D SSCONV S7_PROGR TEST AC AWL Error File D SSCONV S7_PROGR TEST AF SEQ S5 Assignment List D SSCONV S5_PROGR TEST Z0 SEQ Converted Assignment List D SSCONV S7_PROGR TEST S 7 SEQ No Name Std New No MUL 16 Cancel STANDARD Hel Press F1 for help Figure 6 2 C
141. unters C C Data area D DB Converted as shared data addresses System data RS RT RI RJ Not Page area C converted Note on Data Addresses In S7 there are two data block registers the DB register which is predominantly used for shared data blocks and the DI register which is preferred for instance DBs For this reason there are also two types of data addresses The addresses DBX DBB DBW and DBD are addresses of shared data blocks the addresses DIX DIB DIW and DID are addresses of instance DBs During conversion addresses of shared data blocks are used for the data block addresses D DB DW DD Also note how data blocks are converted see Section 3 7 6 Warning ZN Be aware that the size and number areas for address areas and the number and length of blocks for S7 all depend upon the CPU used CPU performance criteria and ratings can be found in Section 2 2 1 From S5 to S7 Converter Manual 3 32 A5E00171227 01 Software 3 11 2 New Addresses in S7 Local Data Local data in STEP 7 are the data assigned to a logic block which are either declared in its declaration section or in its variable declaration Depending on the block they consist of formal parameters static data and temporary data Local data are usually addressed symbolically Block parameters of functions FC are handled like the block parameters in S5 the block parameters represent pointers which po
Download Pdf Manuals
Related Search
Related Contents
[e]motion DSIN8019 SH-series Marking Head Operation Manual Valueline VLAB24170B10 Crate Amplifiers TV-6210 User's Manual LG 65LB6300 Energy Guide : Free Download, Borrow, and Streaming : Internet Archive Model 11 VPF Syringe Pump User`s Manual Manual Copyright © All rights reserved.
Failed to retrieve file