Reference manual SIMATIC S7-1200/S7-1500 Comparison list for programming languages based on international mnemonics Edition 12/2017 support.industry.siemens.com Comparison list for S7-300, S7-400, S7-1200, S7-1500 Reference Manual Legal information Warning notice system This manual includes notices you have to observe to ensure your personal safety and to prevent damage to property. The notices referring to your personal safety are highlighted in the manual by a hazard alert symbol; notices referring only to property damage have no hazard alert symbol. Depending on the degree of danger, warnings are displayed in a descending order as follows. DANGER indicates that death or severe personal injury will result if proper precautions are not taken. WARNING indicates that death or severe personal injury may result if proper precautions are not taken. CAUTION indicates that minor personal injury may result if proper precautions are not taken. NOTICE indicates that damage to property may result if proper precautions are not taken. If more than one degree of danger is present, the warning notice representing the highest degree of danger will be used. A notice warning of injury to persons with a hazard alert symbol may also include a warning relating to property damage. A5E33284667-AF Page 1 Qualified personnel The product/system described in this documentation may be operated only by personnel qualified for the specific task in accordance with the relevant documentation, in particular its warning notices and safety instructions. Qualified personnel are those who, based on their training and experience, are capable of identifying risks and avoiding potential hazards when working with these products/systems. Proper use of SIMATIC products Note the following: WARNING Siemens products may only be used for the applications described in the catalog and the associated technical documentation. If third-party products and components are used, these have to be recommended or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation, and maintenance are required to ensure that the products operate safely and without any problems. The permitted ambient conditions must be adhered to. Notes in the respective documentation must be observed. Trademarks All names identified by (R) are registered trademarks of the Siemens AG. Any other names appearing in this document may be trademarks, the use of which by third parties for their own purposes may breach owners' rights. Disclaimer of liability We have reviewed the contents of this publication to ensure consistency with the hardware and software described. However, since deviations cannot be precluded entirely, we cannot guarantee full consistency. The information in this publication is reviewed regularly and any necessary corrections are included in subsequent editions. Siemens AG Digital Factory P.O. Box 48 48 90026 NUREMBERG Comparison list for S7-300, S7-400, S7-1200, S7-1500 12/2017 A5E33284667-AA Page 2 Contents of the comparison list * Measuring program runtimes - see below. * Load objects to the CPU: Which modifications and which modified blocks you load to the CPU in which operating mode - next page. * Overview, requirements, general conditions and legend for the comparison list (Page 7) * Comparison list for S7-300, S7-400 (not H-Systems), S7-1200, S7-1500 including CPU 150xS Software Controllers: Which instructions and functions you can use for which controller family - as of Page 8. * Instructions for SIMATIC Ident and SIMATIC Energy Suite - appendix. Measuring program runtimes The runtime of parts of the user program depends on many factors. A listing of runtimes of individual instructions in a table is thus not possible. The RUNTIME (runtime measuring) instruction is used to measure the runtime of the entire program, individual blocks or command sequences. The runtime measurement begins with the first call of the RUNTIME instruction and ends with the second call. Use an OB priority >15 for runtime measurement. This ensures that "online monitoring" does not falsify the runtime. You can find more detailed information in the SIMATIC STEP 7 online help. Enter "RUNTIME" in the search and select "S7-1200", "S71500" or "S7-1500T" as validity identifier. Programming examples in SCL: "Common_Data".opt.Last_Cycle := RUNTIME(#Tag_Memory); //Start of the runtime measurement, LReal "speed test FB opt_DB"(ON_2:="i1",...);//Runtime measurement through RUNTIME "Common_Data".opt.Last_Cycle := RUNTIME(#Tag_Memory); //End of the runtime measurement The Last_Cycle tag contains the time that has passed from the preceding call to the current call of RUNTIME. A5E33284667-AF Page 3 Load objects to the CPU The table shows which modifications and which modified blocks you can download in which operating mode. Very complex programs can prevent downloading in RUN mode. Solution approaches: * Use a memory card with sufficient capacity. * Select a CPU with sufficient work memory. * Reduce the number of modified used blocks, constants, PLC tags or data types. You can find information about the behavior of the F-CPU for fail-safe blocks in the SIMATIC Safety - Configuring and Programming manual. Modifications and blocks S7-300 S7-400 S7-1200 S7-1500 S7-1200 S7-1200 V4.0 or V1.0 - 2.1 V2.2 - V3.0 higher STOP, Modified properties of hardware STOP constraints in STOP STOP STOP STOP components RUN STOP, Added hardware components STOP constraints in STOP STOP STOP STOP RUN New/revised text lists RUN RUN RUN (alarms) Load number of blocks RUN (<17) RUN (<57) RUN (<21) RUN STOP RUN (<11) STOP (Reset) STOP (Reset) STOP (Reset) STOP (Reset) STOP (Reset) STOP (Reset) New OB RUN RUN STOP RUN STOP STOP Modified OB: Code modifications, modification of comments RUN RUN RUN RUN STOP RUN Reset work memory (MRES) A5E33284667-AA Page 4 Modifications and blocks S7-300 S7-400 S7-1500 S7-1200 V1.0 - 2.1 S7-1200 V2.2 - V3.0 OB with modified properties (e.g. cycle time change) S7-1200 V4.0 or higher STOP RUN STOP RUN STOP STOP Deleted OB RUN RUN STOP RUN STOP STOP New FB/FC/DB/PLC data type (UDT) RUN RUN RUN RUN STOP RUN RUN RUN RUN RUN STOP RUN RUN RUN RUN RUN STOP RUN STOP STOP RUN (Init) RUN (Init) STOP STOP RUN (Init) RUN (Init) RUN (Init) RUN (Init) STOP STOP -- -- RUN RUN -- -- STOP STOP RUN (Init) RUN (Init) STOP STOP RUN RUN RUN RUN STOP STOP STOP All objects retentive STOP STOP STOP STOP Deleted FB/FC/DB/PLC data type (UDT) Revised FB/FC: Code modification, modification of comments Revised FB/FC: Interface change Modified DB (no memory reserve configured): Name/type of tags modified, tags added or deleted Modified DB (memory reserve configured): New tags added Modified PLC data type (UDT) Modified PLC tags (added, deleted, name or data type changed) Modified retentivity settings (bit memory address area, DB area) A5E33284667-AF Page 5 Modifications and blocks Motion Control technology objects: Changes to MC Servo cycle clock, change from free-running to cyclical (and vice versa). Changes to the hardware interface of the TO S7-300 S7-400 S7-1200 V4.0 or higher S7-1500 S7-1200 V1.0 - 2.1 S7-1200 V2.2 - V3.0 -- -- -- STOP -- -- (init) means that the CPU overwrites the actual values of the DBs with start values during downloading. Comparison list Validity and general conditions * SIMATIC STEP 7 version 15 or higher * The contents of the S7-1500 column also apply to SIMATIC S7-1500 Software Controller CPU 150xS * SIMATIC S7-1200 firmware 4.2 or higher. SIMATIC S7-1200 only supports LAD, FBD and SCL. * SIMATIC S7-1500 firmware 2.5 or higher * STL: Some instructions have to be called via CALL. * The special features of the S7-400 H-Systems are not taken into consideration. * Some system state lists (SSLs) for SIMATIC S7-300/400 contain similar information such as function calls with the SIMATIC S7-1200/1500. A5E33284667-AA Page 6 Structure of the comparison list * Basic instructions Instructions that you use often, such as bit logic operations, timers, counters, mathematical functions * Extended instructions Extended instructions for more possibilities such as date and time, interrupts, alarms, PROFIenergy * Technological instructions (technology) Technological functions, such as PID control, motion control * Instructions for communication (communication) Instructions for communication, such as S7 communication, Open User Communication Legends () nn Grayed out Xyz Xyz Xyz Applicable Applicable with restrictions Not required, you can, for example, program with simple commands in SCL. We recommend that you do not use the grayed out instructions in S7-1200 or S7-1500, because these instructions are not suitable for symbolic addressing or multiple instances. SIMATIC counters and timers are not recommended because they do not have multiple instance capability. New instruction as of SIMATIC STEP 7 V14. For this purpose, SIMATIC S7-1200 requires at least firmware 4.2 and SIMATIC S7-1500 at least firmware 2.0. New instruction as of SIMATIC STEP 7 V15. For this purpose, SIMATIC S7-1200 requires at least firmware 4.2 and SIMATIC S7-1500 at least firmware 2.5. Also available as fail-safe instruction in the Safety optional package in LAD and FBD. A5E33284667-AF Page 7 Basic instructions Technology Extended instructions Communication Instructions in the section "Basic instructions" Instruction groups Page Instruction groups Page Instruction groups Page Word logic operations 29 Bit logic operations 9 Mathematical functions 16 Shift and rotate 30 Safety functions 11 Move 18 Load and transfer 31 Times 12 Conversion operations 22 Legacy 32 Counter operationss 13 Program control operations 25 S7-1500 14 S7-400 Comparator operations S7-1200 8 S7-300 General Description LAD/FBD General Insert network Insert empty box Open branch Close branch Insert input Invert Boolean result A5E33284877-AA -| -|NOT|- STL (not S7-1200) SCL nn nn nn ( ) nn -o| nn NOT Page 8 S7-400 S7-1500 () () S7-300 S7-1200 Basic instructions Extended instructions Description Bit logic operations Technology LAD/FBD Communication STL (not S7-1200) SCL O O X = & OR XOR := AND logic operation OR logic operation EXCLUSIVE OR logic operation Assignment Negate assignment Reset output Set output Set bit field S7-400: SFC 79 SET Reset bit field S7-400: SFC 89 RSET Set/reset flip-flop Reset/set flip-flop Scan operand for positive signal edge & >=1 X -( )-[=] -(/)-[/=] -(R) -[R] -(S) -[S] SET_BF R S nn nn nn nn RESET_BF nn nn Scan operand for negative signal edge -|N|- Set operand on positive signal edge Set operand on negative signal edge A5E33284667-AF SR RS -|P|- -(P)-(N)- NOT nn nn <Operand>; FP; <Operand>; FN; R_TRIG F_TRIG nn nn nn nn Page 9 S7-400 S7-1200 S7-1500 S7-300 Basic instructions Technology Extended instructions Description Scan Boolean result for positive signal edge Scan Boolean result for negative signal edge Detect positive signal edge SCL: Programming with two instructions is more effective: Detect negative signal edge SCL: Programming with two instructions is more effective: Normally open contact Normally closed contact LAD/FBD P_TRIG N_TRIG A5E33284667-AA STL (not S7-1200) FP FN R_TRIG posFlanke := signal and not laststate; laststate := signal; negFlanke := not signal and not laststate; laststate := not signal; Communication SCL nn nn F_TRIG -||-|/|- nn nn nn nn nn nn Page 10 S7-300 S7-400 S7-1200 S7-1500 Basic instructions Extended instructions Description Technology LAD/FBD Communication STL (not S7-1200) SCL Safety functions Only Safety: EMERGENCY STOP up to Stop Category 1 Only Safety: Two-hand monitoring Only Safety: Two-hand monitoring with enable Only Safety: parallel muting with two or four muting sensors Only Safety: parallel muting with two or four muting sensors Only Safety: 1oo2 evaluation of two singlechannel encoders combined with a discrepancy analysis Only Safety: Feedback monitoring Only Safety: Protective door monitoring. Only Safety: Acknowledgment for simultaneous reintegration of all F-I/O/channels of the F-I/O of an F-runtime group after communication errors or F-I/O/channel errors A5E33284667-AF ESTOP1 TWO_HAND TWO_H_EN MUTING MUT_P EV1oo2DI FDBACK SFDOOR ACK_GL Page 11 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Times IEC timers Generate pulse Generate on-delay Generate off-delay Time accumulator Time accumulator (start timer) Reset timer Load time duration Generate pulse Start on-delay timer Start off-delay timer SIMATIC timers legacy Assign pulse timer parameters and start Assign extended pulse timer parameters and start Assign on-delay timer parameters and start Assign retentive on-delay timer parameters and start Assign off-delay timer parameters and start A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL IEC timers are multi-instance capable. TP TP TON TON TOF TOF TONR -(TONR)- -[TONR]nn nn -(RT)-[RT]RESET_TIMER -(PT)-[PT]PRESET_TIMER -(TP)-[TP]nn TP -(TON)-[TON]SD S_ODT -(TOF)-[TOF]SF S_OFFDT S_PULSE S_PEXT nn nn S_PULSE S_PEXT S_ODT S_ODTS nn nn S_ODT S_ODTS S_OFFDT nn S_OFFDT Page 12 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Start pulse timer Start extended pulse timer Enable timer Load timer value Load BCD-coded timer value Reset timer Start off-delay timer Start on-delay timer Start retentive on-delay timer Counters IEC counters Count up Count down Count up and down SIMATIC counters legacy Assign parameters and count up Assign parameters and count down Assign parameters and count up/down Set initial counter value A5E33284667-AF Technology LAD/FBD -(SP) -(SD) -[SP] -[SD] -(R) -(SF) -(SD) -(SS) -[R] -[SF] -[SD] -[SS] Communication STL (not S7-1200) SCL SP SD FR L LC R SF SD SS nn nn nn nn nn nn nn nn nn IEC counters are multi-instance capable. CTU CTU CTD CTD CTUD CTUD S_CU S_CD S_CUD -(SC) -[SC] nn nn nn nn S_CU S_CD S_CUD nn Page 13 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Count up Count down Enable counter Load counter value Load BCD-coded counter value Reset counter Set counter Equal Not equal Greater than or equal Less than or equal Greater than Less than Value within range Value outside range Comparator operations A5E33284667-AA Technology LAD/FBD -(CU) -(CD) -[CU] -[CD] CMP == CMP <> CMP >= CMP <= CMP > CMP < IN_RANGE OUT_RANGE Communication STL (not S7-1200) SCL CU CD FR L LC R S nn nn nn nn nn nn nn == I/D/R <> I/D/R >= I/D/R <= I/D/R > I/D/R < I/D/R = <> >= <= > < nn nn Page 14 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Check validity Check invalidity Variant Check data type of a VARIANT tag Scan data type of an ARRAY element of a VARIANT tag Compare data type for EQUAL with the data type of a tag Compare data type of an ARRAY element for EQUAL with the data type of a tag With a tag of type DB_ANY, compare the data type of an indirectly addressed DB with a data type for EQUAL. Identify any data block with DB_ANY. You then have the option of accessing a data block that is not yet available during programming. Compare data type for UNEQUAL with the data type of a tag Compare data type of an ARRAY element for UNEQUAL with the data type of a tag A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) -|OK|-|NOT_OK|- SCL nn nn TypeOf TypeOfElements EQ_Type *) EQ_ElemType *) EQ_TypeOfDB: *) NE_Type *) NE_ElemType *) Page 15 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description With a tag of TYPE DB_ANY, compare the data type of an indirectly addressed DB with a data type for EQUAL. Check for EQUALS NULL pointer Check for UNEQUALS NULL pointer Technology LAD/FBD Communication STL (not S7-1200) SCL NE_TypeOfDB: *) IS_NULL NOT_NULL *) *) *) Application examples for SCL: IF TypeOf(...) = INT THEN ... // corresponds to EQ_Type IF TypeOfElements(...) = INT THEN ... // corresponds to EQ_ElemType IF TypeOfDB(...) = INT THEN ... // corresponds to EQ_TypeOfDB IF ... <> NULL THEN ... // corresponds to NOT_NULL Instead of "=", you can also use other operators, e.g.: "<>". Instead of "INT", you can also use any other data types or data types that you have defined, e.g.: "REAL", "Recipe". Check for ARRAY Compare tag structured data types Mathematical functions Calculate Add Subtract Multiply A5E33284667-AA IS_ARRAY CompType CALCULATE (SCL network in LAD/FBD) ADD SUB MUL nn nn nn + * + * Page 16 S7-400 S7-1200 S7-1500 S7-300 Basic instructions Extended instructions Description Divide Form absolute value Safety instruction only for S7-1200/1500 Return remainder of division Create twos complement Create ones complement Increment Decrement Get minimum Get maximum Set limit value Form square Form square root Form natural logarithm Form exponential value Form sine value Form cosine value Form tangent value Form arcsine value Form arccosine value A5E33284667-AF Technology Communication LAD/FBD STL (not S7-1200) SCL DIV ABS / ABS / ABS NEG nn MOD NEGI, NEGD INVI, INVD INC DEC nn NOT nn nn MIN MAX LIMIT SQR SQRT LN EXP SIN COS TAN ASIN ACOS Page 17 S7-400 S7-1200 () () S7-1500 S7-300 Basic instructions Extended instructions Description Form arctangent value Return fraction Exponentiate Move () () Move value S7-300/400: Only LAD and FBD Only Safety: Write value indirectly to an F-DB Only Safety: Read value indirectly from an FDB Only Safety: Read value from INT F-Array Only Safety: Read value from DINT F-Array Move data type from ARRAY of BYTE (Deserialize) Move data type to ARRAY of BYTE (Serialize) Move block S7-400: SFC 20 BLKMOV Move block not interruptible S7-400: SFC 81 UBLKMOV Move block Fill block A5E33284667-AA Technology Communication STL (not S7-1200) LAD/FBD SCL ATAN FRAC EXPT ** FRAC ** MOVE MOVE := WR_FBD RD_FBD RD_ARRAY_I RD_ARRAY_DI Deserialize Serialize MOVE_BLK UMOVE_BLK MOVE_BLK_VARIANT FILL_BLK Page 18 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Fill block not interruptible Disassemble a tag bit string data type BYTE, WORD, DWORD or LWORD into individual bits (= scatter) Disassemble an ARRAY of BYTE, WORD, DWORD or LWORD into individual bits Merge all bits from an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements into a bit string data type BYTE, WORD, DWORD or LWORD (= gather) Merge individual bits into multiple elements of an ARRAY of BOOL, an anonymous STRUCT or a PLC data type exclusively with Boolean elements Swap A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL UFILL_BLK SCATTER SCATTER_BLK GATHER GATHER_BLK SWAP Page 19 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Attempt assignment of a VARIANT to a reference (AssignmentAttempt): With "AssignmentAttempt", you attempt to assign a VARIANT tag to a reference tag. The data type of a reference tag is specified at the time of the declaration, the data type of a VARIANT tag is determined during runtime. ARRAY DB Read from ARRAY data block Write to ARRAY data block Read from ARRAY data block in load memory Write to ARRAY data block in load memory Variant Read out VARIANT tag value Write VARIANT tag value Get number of ARRAY elements ARRAY [*] Read out ARRAY low limit Read out ARRAY high limit A5E33284667-AA Technology LAD/FBD ?= Communication STL (not S7-1200) AssignmentAttempt SCL ?= ReadFromArrayDB WriteToArrayDB ReadFromArrayDBL WriteToArrayDBL VariantGet VariantPut CountOfElements LOWER_BOUND UPPER_BOUND Page 20 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Read/write access Recommendation: Symbolic programming. Read data in little endian format Write data in little endian format Read data in big endian format Write data in big endian format Read memory address Read memory bit Write memory address Write memory bit Write memory area Legacy Recommendation: Symbolic programming Move block Move block not interruptible Fill block A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL READ_LITTLE WRITE_LITTLE READ_BIG WRITE_BIG PEEK PEEK_BOOL POKE POKE_BOOL POKE_BLK BLKMOV UBLKMOV FILL Page 21 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description LAD/FBD Read field Recommendation: Indexed access to an array Write field Recommendation: Indexed access to an array FieldRead Convert value S7-1200/1500: Is carried out implicitly, therefore usually not necessary. Only Safety: Convert data of data type BOOL into data of data type WORD Only Safety: Convert data of data type WORD into data of data type BOOL Round numerical value Generate next higher integer from floating-point number Generate next lower integer from floating-point number Truncate numerical value Scale Normalize CONVERT Conversion operations Technology A5E33284667-AA Communication STL (not S7-1200) SCL FieldWrite CONVERT BO_W W_BO ROUND CEIL RND RND+ ROUND CEIL FLOOR RND- FLOOR TRUNC SCALE_X NORM_X Page 22 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Communication LAD/FBD STL (not S7-1200) SCL Create a reference to a tag: "REF()" is used to specify to which tag a previously declared reference should point. Convert BCD to integer (16 bit) Convert integer (16 bit) to BCD Convert BCD to integer (32 bit) Convert integer (32 bit) to BCD nn nn REF nn nn nn nn BTI ITB BTD DTB Convert integer (16 bit) to integer (32 bit) S7-1500: Conversion also done implicitly Convert integer (32 bit) to floating-point number S7-1500: Conversion also done implicitly You can generally convert numerical formats and data types into other numerical formats and data types. You can find more detailed information in the information system of STEP 7 Create ones complement integer (16 bit) S7-1500: Conversion also done implicitly nn ITD BCD16_TO_INT INT_TO_BCD16 BCD32_TO_INT DINT_TO_BCD3 2 INT_TO_DINT nn DTR DINT_TO_REAL A5E33284667-AF Description CONVERT nn xxx_TO_yyy INVI nn Page 23 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Create ones complement double integer (32 bit) S7-1500: Conversion also done implicitly Negate integer (16 bit) Negate integer (32 bit) Negate floating-point number Switch bytes in the right word of accumulator 1 Switch all bytes in accumulator 1 Variant instructions Convert VARIANT to DB_ANY Convert DB_ANY to VARIANT Legacy Recommendation: Symbolic programming Convert the integer to a floating-point number scaled in physical units between a low limit and high limit (scaling). A5E33284667-AA Technology Communication LAD/FBD STL (not S7-1200) SCL nn INVD nn nn nn nn nn nn NEGI NEGD NEGR CAW CAD nn nn nn nn nn VARIANT_TO_DB_ANY DB_ANY_TO_VARIANT SCALE SCALE Page 24 S7-1500 S7-400 Extended instructions S7-300 S7-1200 Basic instructions Branch to a list element Run in counting loop Description Unscale the floating-point number into physical units between a low limit and a high limit and convert it into an integer (unscaling). Program control operations Branch conditionally Technology LAD/FBD Communication STL (not S7-1200) UNSCALE JC Branch conditionally multiple times SPL Run in counting loop with step width Run if condition is met, the CPU checks the condition at the start of the loop Run if condition is not met. The CPU checks the condition at the end of the loop, i.e. the CPU runs the loop at least once. A5E33284667-AF SCL JC LOOP IF... THEN... ELSE... IF... THEN... ELSIF... CASE... OF... FOR... TO... DO... FOR... TO... BY... DO... WHILE... DO... REPEAT... UNTIL... Page 25 S7-400 S7-1200 S7-1500 S7-300 Basic instructions Extended instructions Description Terminate running through the loop and start with the next run Exit loop immediately Exit block Organize program code Technology LAD/FBD Communication STL (not S7-1200) CONTINUE RET BEU Conditional block end BEC Insert a comment section // Only SIMATIC S7-1500 Software Controller SHUT_DWN CPU 150xS: Shut down or restart Windows and the controller Jumps Jump Jump if RLO = 1 -(JMP) -[JMP] JC Jump if RLO = 0 -(JMPN) -[JMPN] JCN Jump label LABEL : Define jump list JMP_LIST JL Jump distributor SWITCH Return -(RET) -[RET] Only Safety: Open global data block -(OPN) -[OPN] Unconditional jump JU A5E33284667-AA SCL EXIT RETURN REGION... END_REGION nn //, (*...*) GOTO... nn nn nn nn nn nn nn nn Page 26 S7-400 S7-1500 S7-300 S7-1200 Basic instructions Extended instructions Description Jump if RLO = 1 and save RLO Jump if RLO = 0 and save RLO Jump if BR = 1 Jump if BR = 0 Jump if OV = 1 Jump if OS = 1 Jump if the result is zero Jump if the result is not zero Jump if the result is greater than zero Jump if the result is less than zero Jump if the result is greater than or equal to zero Jump if the result is less than or equal to zero Jump if the result is invalid Loop Data blocks Open global data block S7-1500: only for "non-optimized" blocks Open instance data block S7-1500: only for "non-optimized" blocks A5E33284667-AF Technology Communication LAD/FBD STL (not S7-1200) SCL nn nn nn nn nn nn nn nn nn nn nn JCB JNB JBI JNBI JO JOS JZ JN JP JM JPZ nn nn nn nn nn nn nn nn nn nn nn nn nn nn JMZ JUO LOOP nn nn nn OPN nn OPNI nn Page 27 () S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Swap data block register Load the length of a global data block into accumulator 1 Load the number of a global data block into accumulator 1 Load the length of an instance data block into accumulator 1 Load the number of an instance data block into accumulator 1 Code blocks Call block LAD/FBD: Only for S7-300/400 Conditional block call Unconditional block call Runtime control Limit and enable password legitimation S7-400: SFC 109 PROTECT Restart cycle monitoring time Exit program A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL CDB L DBLG nn nn L DBNO nn L DILG nn L DINO nn CALL nn CC UC nn nn ENDIS_PW RE_TRIGR STP Page 28 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Only SIMATIC S7-1500 Software Controller CPU 150xS: Shut down or restart Windows and the controller Get error locally Get error ID locally Compress CPU memory Control CiR process Initialize all retain data Program time delay Change protection level Runtime measurement with nanosecond accuracy Only Safety: Fail-safe acknowledgment from an operator control and monitoring system Word logic operations Create ones complement Decode Encode Select A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL SHUT_DOWN GET_ERROR GET_ERR_ID COMPRESS CiR INIT_RD WAIT PROTECT RUNTIME F_ACK_OP INV NOT DECO ENCO SEL Page 29 S7-300 S7-400 S7-1200 S7-1500 Basic instructions Extended instructions Technology Communication Description LAD/FBD STL (not S7-1200) SCL Multiplex S7-300/400: Only SCL Demultiplex AND logic operation word by word OR logic operation word by word EXCLUSIVE OR logic operation word by word AND logic operation double word by double word OR logic operation double word by double word EXCLUSIVE OR logic operation double word by double word MUX nn MUX DEMUX AND OR XOR AND nn AW OW XOW AD DEMUX AND, & OR XOR AND, & OR XOR OD XOD OR XOR ROR ROL SRW SLW SSI SSD SRD SLD SHR SHL nn nn nn nn Shift and rotate Rotate right Rotate left Shift right word by word Shift left word by word Shift word by word with sign Shift double word by double word with sign Shift right double word by double word Shift left double word by double word A5E33284667-AA SHR SHL Page 30 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Rotate right double word by double word Rotate left double word by double word Rotate left by status bit CC 1 Rotate right by status bit CC 1 Technology LAD/FBD SHR SHL Loading and transferring the registers in STL Communication STL (not S7-1200) SCL RRD RLD RLDA RRDA SHR SHL nn nn Information on S7-400: The controllers have four accumulators. You will find only the instructions for two accumulators in the list below. Loading Loading Load status word in accumulator 1 Load AR1 with contents of accumulator 1 Load AR1 with double word or area pointer Load AR1 with contents of AR2 Load AR2 with contents of accumulator 1 Load AR2 with double word or area pointer Transfer Transfer Transfer accumulator 1 to status word Switch AR1 and AR2 Transfer AR1 to accumulator 1 A5E33284667-AF nn L L STW LAR1 LAR1 <D> LAR1 AR2 LAR2 LAR2 <D> nn nn nn nn nn nn nn nn T T STW CAR TAR1 nn nn nn nn Page 31 S7-1500 S7-400 Extended instructions S7-300 S7-1200 Basic instructions Implement sequencer Implement sequencer Discrete control time interrupt Motor control time interrupt Compare input bits with the bits of a mask Matrix scanner Lead and lag algorithm Create bit pattern for 7-segment display Create tens complement Count number of set bits Time accumulator Save data to shift register Shift bit to shift register Get status bit Description Technology LAD/FBD Transfer AR1 to double word Transfer AR1 to AR2 Transfer AR2 to accumulator 1 Transfer AR2 to double word Legacy A5E33284667-AA Status -||- Communication STL (not S7-1200) SCL TAR1 <D> TAR1 AR2 TAR2 TAR2 <D> nn nn nn nn DRUM DRUM_X DCAT MCAT IMC SMC LEAD_LAG SEG BCDCPL BITSUM TONR_X WSR SHRB A 0V nn Page 32 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Call block Save RLO in BR bit Open MCR ranges Close MCR ranges Enable MCR range Disable MCR range Set bit array Set byte array Reset bit array Reset byte array Enter substitute value Swap content of accumulators 1 and 2 Shift contents to the next highest accumulator Shift contents to the next lowest accumulator Add accumulator 1 to AR1 Add accumulator 1 to AR2 Program display (null instruction) Null instruction Null instruction A5E33284667-AF Technology LAD/FBD -(CALL) -(SAVE) -(MCR<) -(MCR>) -(MCRA) -(MCRD) -[CALL] -[SAVE] -[MCR<] -[MCR>] -[MCRA] -[MCRD] nn nn nn nn nn nn nn nn Communication STL (not S7-1200) UC SAVE MCR( )MCR MCRA MCRD SET SETI RESET RESETI REPL_VAL TAK PUSH POP +AR1 +AR2 BLD NOP 0 NOP 1 SCL nn nn nn nn nn nn nn nn nn nn nn nn nn nn Page 33 Basic instructions Extended instructions Technology Communication Instructions in the section "Extended instructions" S7-1500 S7-400 S7-1200 S7-300 Instruction groups Date and time String and Character Process image Distributed I/O PROFIenergy Module parameter assignment Page 34 36 39 39 41 42 Instruction groups Interrupts Alarms Diagnostics Pulse Recipes & data logging Data block functions Description Date and time Compare time tags Convert times and extract Add times Subtract times Time difference Combine times Page 42 44 45 47 47 47 Instruction groups Table functions Addressing File operations (file handling) R/H system Other instructions LAD/FBD STL (not S7-1200) Page 48 49 50 51 51 SCL T_COMP* T_CONV* T_ADD* T_SUB* T_DIFF* T_COMBINE* * SCL: Use conversion functions x_TO_y (e.g. TIME_TO_DINT), or comparator and arithmetic operators (e.g. +, -, >, <). A5E33284877-AA Page 34 S7-400 S7-1500 S7-300 S7-1200 Basic instructions Extended instructions Description Time-of-day functions Set time-of-day (STEP 7 V 5x: SET_CLK) Read time-of-day (STEP 7 V 5x: READ_CLK) Read local time Write local time Synchronize slave clocks Read system time Set time zone Runtime meters Set runtime meters Start and stop runtime meters Read runtime meters Set time-of-day and time-of-day status Local time Calculate local time Calculate local time from base time Calculate base time from local time Set time-of-day interrupt using local time A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL WR_SYS_T RD_SYS_T RD_LOC_T WR_LOC_T SNC_RTCB TIME_TCK SET_TIMEZONE RTM SET_RTM CTRL_RTM READ_RTM SET_CLKS LOC_TIME BT_LT LT_BT S_LTINT Page 35 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Technology LAD/FBD Set daylight saving time/standard time without timeof-day status Transfer time-stamped alarms Set daylight saving time/standard time with time-ofday status String and Character Move character string Compare character strings Convert character string Convert character string to numerical value Convert numerical value to character string Convert character string to Array of CHAR Convert Array of CHAR to character string Determine the length of a character string Join multiple character strings Split character array in multiple character strings Convert ASCII string to hexadecimal number (conversion is contained in the converting functions, e.g.: CHAR_TO_WORD) Convert hexadecimal number to ASCII string A5E33284667-AA Communication STL SCL (not S7-1200) SET_SW TIMESTMP SET_SW_S S_MOVE S_COMP := = S_CONV STRG_VAL STRG_... VAL_STRG ..._STRG Strg_TO_Chars Chars_TO_Strg MAX_LEN JOIN SPLIT ATH HTA Page 36 S7-400 S7-1500 S7-1200 S7-300 Basic instructions Extended instructions Description Other instructions Determine the length of a character string Connect character strings Read the left characters of a character string Read the right characters of a character string Read the middle characters of a character string Delete characters in a character string Insert characters in a character string Replace characters in a character string Find characters in a character string Runtime information Read out name of a tag on the input parameter A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL LEN CONCAT LEFT RIGHT MID DELETE INSERT REPLACE FIND GetSymbolName Page 37 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Read global name at beginning of a call path. Illustration: Read out name of the block instance Query the global name of block instance Read out name of block in the block itself A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL GetSymbolPath GetInstanceName GetInstancePath GetBlockName Page 38 Extended instructions S7-1500 S7-400 S7-1200 S7-300 Basic instructions Description Process image Update the process image inputs Update the process image outputs Synchronize the process image inputs Synchronize the process image outputs Distributed I/O DP and PROFINET Read data record Write data record Read process image Transfer process image Read process image area Transfer process image area Receive interrupt Disable/enable DP slaves A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL UPDAT_PI UPDAT_PO SYNC_PI SYNC_PO RDREC WRREC GETIO SETIO GETIO_PART SETIO_PART RALRM D_ACT_DP Page 39 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Control configuration of a PROFINET IO system (options handling) Enable or disable devices in order to, for example, Flexibly run through or bypass production steps of a manufacturing process. Other instructions Read data record from I/O Write data record to I/O Read consistent data of a DP standard slave Write consistent data of a DP standard slave iDevice/iSlave Receive data record Make data record available Send interrupt PROFIBUS Trigger hardware interrupt from DP standard slave Synchronize DP slaves/Freeze inputs Read diagnostics data from a DP slave Determine topology for the DP master system A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL ReconfigIOSystem RD_REC WR_REC DPRD_DAT DPWR_DAT RCVREC PRVREC SALRM DP_PRAL DPSYC_FR DPNRM_DG DP_TOPOL Page 40 Extended instructions S7-1500 S7-400 S7-1200 S7-300 Basic instructions Description ASi Control ASi master behavior Control ASi master behavior PROFIenergy IO controller Start and exit energy-saving mode Start and exit energy-saving mode/Read out status information Set switching behavior of power modules Starting and stopping energy-saving mode via WakeOnLan iDevice/iSlave Control PROFIenergy commands in the iDevice Generate negative answer to command Generate answer to command at start of pause Generate answer to command at end of pause Generate queried energy savings modes as answer Generate scanned energy saving data as answer Generate PEM status as answer A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL ASi_3422 ASI_CTRL PE_START_END PE_CMD PE_DS3_WRITE_ET200S PE_WOL PE_I_DEV PE_Error_RSP PE_Start_RSP PE_End_RSP PE_List_Modes_RSP PE_Get_Mode_RSP PE_PEM_Status_RSP Page 41 Number of PROFIenergy commands Generate supported PROFIenergy commands as answer Generate queried measured values as answer S7-400 S7-300 S7-1500 Extended instructions S7-1200 Basic instructions Module parameter assignment Read module data record (predefined parameters) Read data record of a module asynchronously (predefined parameters) Transfer module data records Read data record from configured system data (predefined parameters) Write module data record (dynamic parameters) Transfer data record (predefined parameters) Description Interrupts Assign an OB to an interrupt event Detach an OB from an interrupt event Cyclic interrupt Set cyclic interrupt parameters Query cyclic interrupt parameters A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL PE_Identify_RSP PE_Measurement_List_RSP PE_Measurement_Value_RSP RD_DPAR RD_DPARA PARM_MOD RD_DPARM WR_PARM WR_DPARM ATTACH DETACH SET_CINT QRY_CINT Page 42 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Time-of-day interrupt Set time-of-day interrupt Set time-of-day interrupt, local or system time LOCAL: Refer SDT to local or system time. ACTIVATE: When does the OB apply the settings. Cancel time-of-day interrupt Activate time-of-day interrupt Query status of time-of-day interrupt Time-delay interrupt Start time-delay interrupt Cancel time-delay interrupt Query the status of a time-delay interrupt Synchronous error events Mask synchronous error events Unmask synchronous error events Read out event status register Asynchronous error event Disable interrupt event Enable interrupt event A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL SET_TINT SET_TINTL CAN_TINT ACT_TINT QRY_TINT SRT_DINT CAN_DINT QRY_DINT MSK_FLT DMSK_FLT READ_ERR DIS_IRT EN_IRT Page 43 S7-300 S7-400 S7-1200 S7-1500 Basic instructions Description Delay execution of higher priority interrupts and asynchronous error events Enable execution of higher priority interrupts and Enable asynchronous events Trigger multicomputing interrupt Alarms Extended instructions Generate program alarm with associated values Output alarm status Generate user diagnostic alarms that are entered in the diagnostics buffer Read pending alarms Acknowledging alarms Write a user diagnostics event to the diagnostics buffer Generate alarm messages Generate alarm message with acknowledgment Create permanently acknowledged PLC alarms Create acknowledgeable PLC alarms Determine acknowledgment status of the last A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL DIS_AIRT EN_AIRT MP_ALM Program_Alarm Get_AlarmState Gen_UsrMsg Get_Alarm Ack_Alarms WR_USMSG ALARM_S ALARM_SQ ALARM_D ALARM_DQ ALARM_SC Page 44 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description ALARM_SQ incoming alarm Report up to eight signal changes Create PLC alarms without associated values for eight signals Create PLC alarms with associated values for eight signals Report a signal change Create PLC alarms with acknowledgment display Send archive data Other instructions Read out dynamically assigned system resources Delete dynamically assigned system resources Enable PLC alarms Disable PLC alarms Diagnostics Read current OB start information Read runtime statistics Determine OB program runtime Determine current connection status A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL NOTIFY_8P ALARM_8 ALARM_8P NOTIFY ALARM AR_SEND READ_SI DEL_SI EN_MSG DIS_MSG RD_SINFO RT_INFO OB_RT C_DIAG Page 45 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Read system status list Read LED status Reading identification and maintenance data Read out name of a module Read information of an IO device Read out checksum Read out information about the memory card Read out status of the CPU clock Is time synchronization via NTP server enabled? Time synchronization missed? Is automatic adjustment for daylight saving time enabled? Read module status information in an IO system Read module status information of a module Generate diagnostics information Read diagnostics information A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL RDSYSST LED Get_IM_Data Get_Name GetStationInfo GetChecksum GetSMCinfo GetClockStatus DeciveStates ModuleStates GEN_DIAG GET_DIAG Page 46 Extended instructions S7-1500 S7-400 S7-1200 S7-300 Basic instructions Description Pulse Pulse width modulation Pulse train output, output a pulse sequence with specified frequency Technology LAD/FBD Communication STL (not S7-1200) SCL CTRL_PWM CTRL_PTO Recipes & data logging Recipe functions Export recipe Import recipe Data logging Create data log Open data log Write data log Empty data log Close data log Delete data log Data log in new file Create data block Create data block Data block functions A5E33284667-AF RecipeExport RecipeImport DataLogCreate DataLogOpen DataLogWrite DataLogClear DataLogClose DataLogDelete DataLogNewFile CREAT_DB CREATE_DB Page 47 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Create data block in the load memory Read from data block in the load memory Write to data block in the load memory Read data block attributes Delete data block Delete data block Test data block Table functions Add value to table Output first value of the table Find value in table Output last value in table Execute table instruction Run value from table Link value logically with table element and save Calculate standard deviation Correlated data tables Link tables Collect/distribute table data A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL CREA_DBL READ_DBL WRIT_DBL ATTR_DB DEL_DB DELETE_DB TEST_DB ATT FIFO TBL_FIND LIFO TBL TBL_WRD WRD_TBL DEV CDT TBL_TBL PACK Page 48 S7-1500 S7-400 Determine hardware identifier from slot Determine slot from the hardware identifier Determine the hardware identifier from addressing of STEP 7 V5.5 SPx Determine hardware identifier from an IO address Determine the IO addresses from the hardware identifier Other instructions for addressing S7-300/400: Determine start address from slot S7-1500: Determine hardware identifier from slot. Exists only for compatibility reasons, not recommended S7-300/400: Determine slot from a logical address S7-1500: Determine slot from the hardware identifier. Exists only for compatibility reasons, not recommended Extended instructions S7-1200 S7-300 Basic instructions Description Addressing A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL GEO2LOG LOG2GEO LOG2MOD IO2MOD RD_ADDR GEO_LOG LOG_GEO Page 49 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description S7-300/400: Determine all logical addresses from a logical address S7-1500: Determine the logical addresses from the hardware identifier S7-300/400: Determine logical basic address from slot and offset in the user data address area S7-1500: Determine hardware identifier from slot and offset in the user data address area S7-300/400: Determine slot and offset in the user database from a logical address S7-1500: Determine slot from the hardware identifier. Exists only for compatibility reasons, not recommended Technology LAD/FBD Communication STL (not S7-1200) SCL RD_LGADR File operations (file handling) Read data from an ASCII file from the memory card Write data to an ASCII file on the memory card A5E33284667-AA GADR_LGC LGC_GADR FileReadC FileWriteC Page 50 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description R/H system RH Only S7-1500 R/H: Enable or disable the SYNCUP system state. The lock applies: Until you disable the lock again Until the S7-1500R/H goes to STOP Technology LAD/FBD Communication STL (not S7-1200) SCL RH_CTRL Other instructions iSlave Set own network address as DP iSlave A5E33284667-AF SET_ADDR Page 51 Basic instructions Extended instructions Communication Technology Instructions in the section "Technology" Instruction groups Page Instruction groups Page Instruction groups Page Counting (and measuring) 52 Function modules 55 Time-driven inputs/outputs 55 PID Control 53 S7-300C functions 55 Motion Control 56 T in the S7-300 column means: Instruction for the S7-300 Technology CPU S7-31xT. The operating principle of the instructions can differ between S7-300 and S7-1500. Instructions solely for the S7-31xT are not listed in the table. The Technology CPU S7-31xT cannot be programmed in the TIA Portal. S7-1500 S7-400 S7-1200 S7-300 T in the S7-1500 column means: Instruction for the Technology CPU S7-15xyT. Description Counting (and measuring) Control high-speed counters High-speed counter for counting and measuring Detect position with SSI absolute encoder A5E33284667-AA LAD/FBD STL (not S7-1200) SCL CTRL_HSC High_Speed_Counter SSI_Absolut_Encoder Page 52 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Communication Technology LAD/FBD STL (not S7-1200) SCL PID Control Compact PID Universal PID controller with integrated tuning for proportional-action actuators PID controller with integrated optimization for valves and actuators Temperature controller with integrated optimization for temperature processes PID basic function Continuous-action controller Step controller for integrating actuators Pulse generator for proportional-acting actuators Continuous temperature controller with pulse generator Temperature controller for integrating actuators A5E33284667-AF PID_Compact PID_3Step PID_Temp CONT_C CONT_S PULSEGEN TCONT_CP TCONT_S Page 53 S7-1500 S7-400 Extended instructions S7-300 S7-1200 Basic instructions Automatic optimization for a continuousaction controller Automatic optimization for a step controller Description Integrated system functions Continuous-action controller Step controller for integrating actuators Pulse generator for proportional-acting actuators Help functions Mapping an input value to an output value using a characteristic curve. The characteristic curve is a polyline with maximum 50 interpolation points with linear interpolation. Converting input value into an output value Limiting the change speed of a signal A5E33284667-AA Communication Technology LAD/FBD STL (not S7-1200) SCL TUN_EC TUN_ES CONT_C_SF CONT_S_SF PULSGEN_SF Polyline SplitRange RampFunction Page 54 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Communication Technology LAD/FBD STL (not S7-1200) SCL Function modules Diverse instructions for FM modules Counting/Positioning/Cam Control/PID Control/Temp Control S7-300C functions Position with analog output Position with digital output Control counter Control frequency measurement Control pulse width modulation Time-driven inputs/outputs Synchronize TIO modules Read in process input signals with time stamps Read in edges at digital input and associated time stamps Time-controlled output of process output signals A5E33284667-AF ANALOG DIGITAL COUNT FREQUENC Pulse TIO_SYNC TIO_IOLink_IN TIO_DI TIO_IOLink_OUT Page 55 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Output edges time-controlled at digital output T T T T T T T T Motion Control Release/lock axis/technology Acknowledge interrupts, restart axis/technology object Home axis/technology objects, set home position Pause axis Position axis absolutely Position axis relatively Move axis at set velocity/speed Move axis in jog mode Run axis commands as motion sequence Change dynamic settings of axis Write tag of positioning axis A5E33284667-AA Communication Technology LAD/FBD STL (not S7-1200) SCL TIO_DQ MC_Power MC_Reset MC_Home MC_Halt MC_MoveAbsolute MC_MoveRelative MC_MoveVelocity MC_MoveJog MC_CommandTable MC_ChangeDynamic MC_WriteParam Page 56 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description T Continuously read motion data of a positioning axis T Set alternative encoder as active encoder Position axis overlapping Output cams, cam track, measuring input Start one-time measuring Start cyclic measuring T T T T Cancel active measuring job Activate/deactivate output cam T T Activate/deactivate cam track Gearing/camming Start gearing Start gearing with specified synchronous T positions T T A5E33284667-AF Communication Technology LAD/FBD STL (not S7-1200) SCL MC_ReadParam MC_SetSensor MC_MoveSuperImposed MC_MeasuringInput S7-1500: MC_MeasuringInputCyclic S7-300T: MC_MeasuringInput S7-1500: MC_AbortMeasuringInput S7-300T: MC_MeasuringInput S7-1500: MC_OutputCam (position-based cams and timebased cams S7-300T: MC_CamSwitch (position-based cam) S7-300T: MC_CamSwitchTime (time-based cam) MC_CamTrack MC_GearIn S7-1500T: MC_GearInPos S7-300T: MC_GearIn Page 57 S7-1500 S7-400 S7-1200 S7-300 Basic instructions T T T T T T T T T T T T T Extended instructions Description Relative shift of master value on the following axis Absolute shift of master value on the following axis Start camming Simulate synchronous operation Cam disc Interpolating a cam disc Read master value of a cam Read out slave value of a cam MotionIn Set motion setpoints for velocity and T acceleration Set motion setpoints for position, velocity and T acceleration A5E33284667-AA Communication Technology LAD/FBD STL (not S7-1200) SCL S7-1500T: MC_PhasingRelative S7-300T: MC_Phasing S7-1500T: MC_PhasingAbsolute S7-300T: MC_Phasing MC_CamIn MC_SynchronizedMotionSimulation MC_InterpolateCam S7-1500T: MC_GetCamLeadingValue S7-300T: MC_GetCamPoint S7-1500T: MC_GetCamFollowingValue S7-300T: MC_GetCamPoint MC_MotionInVelocity MC_MotionInPosition Page 58 T S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Torque data Specify additive torque Set high and low torque limits Activate and deactivate force/torque limit/ fixed stop detection Motions (kinematics) T Interrupt execution of motion T Continue execution of motion T Stop motion Position kinematics absolutely with linear path T motion Relative positioning of kinematics with linear T path motion Position kinematics absolutely with circular T path motion Relative positioning of kinematics with circular T path motion A5E33284667-AF Communication Technology LAD/FBD STL (not S7-1200) SCL Force/torque limiting / fixed stop detection MC_TorqueAdditive MC_TorqueRange MC_TorqueLimiting MC_GroupInterrupt MC_GroupContinue MC_GroupStop MC_MoveLinearAbsolute MC_MoveLinearRelative MC_MoveCircularAbsolute MC_MoveCircularRelative Page 59 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Zones Define workspace zone Define kinematics zone Activate workspace zone Deactivate workspace zone Activate kinematics zone Deactivate kinematics zone Toolbox T Re-define tool T Change active tool Coordinate systems T Redefine object coordinate systems T T T T T T A5E33284667-AA Communication Technology LAD/FBD STL (not S7-1200) SCL MC_DefineWorkspaceZone MC_DefineKinematicsZone MC_SetWorkspaceZoneActive MC_SetWorkspaceZoneInactive MC_SetKinematicsZoneActive MC_SetKinematicsZoneInactive MC_DefineTool MC_SetTool MC_SetOcsFrame Page 60 Basic instructions A5E33284667-AF Extended instructions Technology Communication Page 61 Basic instructions Extended instructions Technology Communication The following pages provide an overview of the details and usage of important functions of open communication and S7 communication. Open communication Definition: Open exchange of data via PROFINET/Industrial Ethernet between SIMATIC controllers or between SIMATIC controllers and third-party devices. Example of suitable interfaces: * Integrated PROFINET/Industrial Ethernet interfaces of controllers * PROFINET/Industrial Ethernet interfaces of communication modules Due to the open and flexible communication, the size of a sent data package is not automatically known to the receiver. TCP or ISO-on-TCP ensures the arrival of the data at the receiver through a transport acknowledgment. To ensure that the data has arrived completely in the application of the receiver, you must determine: 1. Determine the size of the data package in the sender. 2. Transfer the size of the data package to the receiver. 3. Evaluate the information in the receiver. A5E33284667-AA Page 62 S7-1500 S7-1200 S7-300/400 Basic instructions Instruction TSEND/TRCV Extended instructions TCP or ISO-on-TCP Reliable with <= 64 KB acknowledgment Exception S7-1200: <= 8 KB Exchange large data volumes with acknowledgment. For example: Send data block with measured value logs to any network node. UDP Fast, without acknowledgment Distribute larger amounts of data without acknowledgment. For example: Distribute position data quickly to many devices. (connection establishment termination are integrated) () TUSEND/TURCV (not S7-300) Data package size Integrated interface: Max. 1472 bytes CP on S7-300/400: Max. 2048 bytes A5E33284667-AF Communication Property of the data transfer TSEND_C/TRCV_C and Technology Logs Application and application example An exact calculation of the limits is available in the controller manuals. Page 63 Basic instructions Extended instructions Technology Communication S7 communication Definition: SIMATIC-homogeneous data exchange between SIMATIC CPUs via PROFIBUS or PROFINET/Industrial Ethernet. With S7 communication, you connect existing S7-300/400 to S7-1200/1500 or migrate existing systems to S7-1200/1500. Recommendation: Use open communication for data exchange between S7-1200/1500 and thus the possibilities of common Ethernet standards. Coordinated data transmission with BSEND and BRCV BSEND sends data to an instruction of the type BRCV in a partner controller. Since BSEND and BRCV coordinate the data transfer, BSEND/BRCV transport the largest amount of data of all the configured S7 connections. BSEND segments the data area to be sent and sends each segment individually to the partner. BRCV acknowledges the acceptance of the sent segment. When BRCV has acknowledged the receipt of the complete data area, you can start a new send job BSEND. Uncoordinated data transmission with USEND and URCV USEND sends data to an instruction of the type URCV in a partner controller. URCV does not acknowledge the receipt of the data. The data transfer is not coordinated with the partner controller. This means that USEND can overwrite received data before URCV has written all the data to the target area. If USEND overwrites data, the receiver outputs an error message. A5E33284667-AA Page 64 Basic instructions S7-300/400 S7-1200 S7-1500 GET GET_S Extended instructions Instruction Operating Property of state of the data partner transfer controller RUN or STOP Technology Guaranteed user Application data size for specified partner controller Reliable with S7-300: acknowledgme S7-400: nt S7-1200: S7-1500: 160 bytes 400 bytes 160 bytes 880 bytes PUT PUT_S BSEND/BRCV: RUN USEND/URCV USEND_S/ URCV_S A5E33284667-AF Communication Notes Accessing data in the target controller without any programming. For example, read operating data. You have to use data blocks with absolute addressing. Symbolic addressing is not possible. You must also Changing data in the target enable this service in the controller without any programming. For example, write CPU configuration in the "Protection" area. parameters in a data block and change a recipe. S7-300: 32768/ Exchange large amounts of data. Coordinated transmission 65534 bytes For example, send data block with (See above) S7-400: 65534 bytes measured value logs to a SCADA S7-1500: 65534 bytes, system for further evaluation. optimized: 65535 bytes Fast, without S7-300: 160 bytes acknowledgme S7-400: 440 bytes nt S7-1500: 920 bytes Control multiple controllers, or Uncoordinated send data to multiple controllers. transmission For example, distribute actual (See above) values of a sensor to several controllers. Page 65 Extended instructions Basic instructions Technology Communication Instructions in the section "Communication" 71 Communication with I-slave 82 S7 communication 66 Modbus TCP 72 PROFINET CBA 82 Open User Communication 68 Communications processors 73 MPI communication 83 OPC UA 69 S7-300C functions 81 TeleService 83 WEB server 71 S7-1500 Page Fail-safe HMI panels S7-400 Instruction groups 66 S7-1200 Page PROFINET and PROFIBUS S7-300 Instruction groups Description PROFINET and PROFIBUS Only Safety: Fail-safe sending of data via PROFIBUS DP/PROFINET IO Only Safety: Fail-safe receipt of data via PROFIBUS DP/PROFINET IO S7 communication Read data from a remote CPU Write data to a remote CPU A5E33284667-AA Instruction groups LAD/FBD Page STL (not S7-1200) SCL SENDDP RCVDP GET PUT Page 66 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Description Send data uncoordinated Receive data uncoordinated Send data in segments Receive data in segments Initiate a warm or cold restart in a remote device Transition a remote device to STOP state Initiate a restart in a remote device. Query the status of a remote partner Receive remote device status change Query the status of connection that belongs to an SFB instance Query connection status Only Safety: Fail-safe sending of data via S7 connections Only Safety: Fail-safe receipt of data via S7 connections A5E33284667-AF LAD/FBD Communication STL (not S7-1200) SCL USEND URCV BSEND BRCV START STOP RESUME STATUS USTATUS CONTROL C_CNTRL SENDS7 RCVS7 Page 67 Extended instructions S7-1500 S7-400 S7-1200 S7-300 Basic instructions Technology Description Other instructions Read data from a remote CPU Write data to a remote CPU Send data uncoordinated Receive data uncoordinated Compact instructions (..._C) Connect and Disconnect are integrated Manage communication connection and send data via Ethernet Manage communication connection and receive data via Ethernet Manage communication connection and transfer email Other instructions Establish communication connection Terminate communication connection Send data via communication connection Receive data via communication connection Open User Communication A5E33284667-AA LAD/FBD Communication STL (not S7-1200) SCL Note: S stands for short, since only one parameter is possible GET_S PUT_S USEND_S URCV_S TSEND_C TRCV_C TMAIL_C TCON TDISCON TSEND TRCV Page 68 S7-1500 S7-400 Extended instructions S7-1200 S7-300 Basic instructions Resetting the connection Check the connection Configure interface Program-controlled IP and connection configuration via SEND/RECEIVE Send data via Ethernet (UDP) Receive data via Ethernet (UDP) Change IP configuration parameters Swap data using FETCH and WRITE via TCP Swap data using FETCH and WRITE via ISO-on-TCP Technology Description OPC UA OPC UA server Query to operating system whether the serve method was called. If the server method was called, the instruction provides the input parameters for the server method. Information to operating system that the server method was called and that the values of the output parameters are valid. A5E33284667-AF Communication LAD/FBD STL (not S7-1200) SCL T_RESET T_DIAG T_CONFIG IP_CONFIG TUSEND TURCV IP_CONF FW_TCP FW_IOT OPC_UA_ServerMethodPre OPC_UA_ServerMethodPost Page 69 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Description OPC UA: CP 443-1 OPC UA Establish connection for a session with an OPC UA server Fetching namespace index of a namespace URL Registering node IDs on the connected server and fetching node handles in the form of a list Reading out the data from nodes of the connected server using the list of node handles Writing the data in nodes of the connected server using the list of node handles On the server, enable the node handles of the list used Terminate connection of a current session with an OPC UA server A5E33284667-AA LAD/FBD Communication STL (not S7-1200) SCL UA_Connect UA_NamespaceGetIndex UA_NodeGetHandleList UA_ReadList UA_WriteList UA_NodeReleaseHandleList UA_Disconnect Page 70 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Technology LAD/FBD Communication STL (not S7-1200) SCL Schematic flow: Web server Synchronize user-defined web pages Fail-safe HMI panels For Mobile Panel 277 F IWLAN: Communication with connected device via PROFIsafe For Mobile Panel 277 F IWLAN: Managing of up to 4 panels in the effective range A5E33284667-AF WWW F_FB_MP F_FB_RNG_4 Page 71 S7-400 Extended instructions Technology Description For Mobile Panel 277 F IWLAN: Managing of up to 16 panels in the effective range For Mobile Panels of the second generation: Communication with connected device via PROFIsafe For Mobile Panels of the second generation: Managing of panels in the effective range S7-1500 S7-300 S7-1200 Basic instructions Modbus TCP Communicate via PROFINET as Modbus TCP client Communicate via PROFINET as Modbus TCP server Communicate redundantly via PROFINET as MODBUS TCP client Communicate redundantly via PROFINET as a MODBUS TCP server Establish communication between a CPU with integrated PN interface and a partner that supports the Modbus/TCP protocol. Connection management Communicate via Ethernet as Modbus TCP client Communicate via Ethernet as Modbus TCP server A5E33284667-AA Communication STL LAD/FBD (not S7-1200) SCL F_FB_RNG_16 F_FB_KTP_ Mobile F_FB_KTP_RNG MB_CLIENT MB_SERVER MB_RED_CLIENT MB_RED_SERVER MODBUSPN TCP_COMM MOD_CLI MOD_SRV Page 72 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Technology LAD/FBD Communication STL (not S7-1200) SCL Communications processors Not for S7-1500 Software Controller CPU 150xS Point-to-Point or PtP communication S7-300/400: Commands for ET 200SP CM PtP Configure PtP communication port S7-300/400: Only if ET 200SP CM PtP is used Configure PtP sender Configure PtP recipient Configure 3964 (R) protocol Send data Receive data Delete receive buffer Read status Set accompanying signals Get extended functions Set extended functions A5E33284667-AF Port_Config Send_Config Receive_Config P3964_Config Send_P2P Receive_P2P Receive_Reset Signal_Get Signal_Set Get_Features Set_Features Page 73 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Description Instructions with lower memory requirements, but also less functional scope. Configure communication parameters dynamically Configure serial transmission parameters dynamically Configure serial receive parameters dynamically Transmit send buffer data Enable receive messages Delete receive buffer Query RS 232 signals Set RS 232 signals USS communication S7-300/400: Commands for ET200SP CM PtP Edit communication via USS network Communication via USS network (16 drives) Communication via USS network (31 drives) Prepare and display data for the drive Data exchange with the drive (16 drives) Data exchange with the drive (31 drives) A5E33284667-AA Communication LAD/FBD STL (not S7-1200) SCL Recommendation: Use the instructions specified above. You cannot apply the instructions decentrally in an ET 200. PORT_CFG SEND_CFG RCV_CFG SEND_PTP RCV_PTP RCV_RST SGN_GET SGN_SET USS_PORT USS_Port_Scan USS_Port_Scan_31 USS_Drive USS_Drive_Control USS_Drive_Control_31 Page 74 S7-400 S7-1200 S7-1500 Extended instructions S7-300 Basic instructions Read out parameters from the drive Read data from drive (16 drives) Read data from drive (31 drives) Change parameters in the drive Change data in drive (16 drives) Change data in drive (31 drives) MODBUS (RTU) S7-300/400: Commands for ET200SP CM PtP Configure communication module for Modbus Communicate as Modbus master Communicate as Modbus slave Technology Description Instructions with lower memory requirements, but also less functional scope. Configure port on the PtP module for Modbus RTU Communicate via the PtP port as Modbus master Communicate via the PtP port as Modbus slave A5E33284667-AF Communication LAD/FBD STL (not S7-1200) SCL USS_RPM USS_Read_Param USS_Read_Param_31 USS_WPM USS_Write_Param USS_Write_Param_31 Modbus_Comm_Load Modbus_Master Modbus_Slave Recommendation: Use the instructions specified above. You cannot apply the instructions decentrally with a CM or in an ET 200. MB_COMM_LOAD MB_MASTER MB_SLAVE Page 75 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Point-to-point connection: CP 340 Receive data Send data Output alarm text with up to 4 tags to printer Delete receive buffer Read accompanying signals at the RS 232 interface Write accompanying signals at the RS 232 interface Point-to-point connection: CP 341 Receive or provide data Send or fetch data Output alarm text with up to 4 tags to printer Read accompanying signals at the RS 232 interface Write accompanying signals at the RS 232 interface Point-to-point connection: CP 440 Receive data Send data Delete receive buffer A5E33284667-AA Technology LAD/FBD Communication STL (not S7-1200) SCL P_RCV P_SEND P_PRINT P_REST V24_STAT_340 V24_SET_340 P_RCV_RK P_SND_RK P_PRT341 V24_STAT V24_SET RECV_440 SEND_440 RES_RECV Page 76 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Description Point-to-point connection: CP 441 Read accompanying signals at the RS 232 interface Write accompanying signals at the RS 232 interface Send data to printer MODBUS slave (RTU) Modbus slave instruction for CP 341 Modbus slave instruction for CP 441 MODBUS: CP 443 Establish communication between a CP and a partner that supports the OPEN MODBUS/TCP protocol Communicate as Modbus client Communicate as Modbus server A5E33284667-AF LAD/FBD Communication STL (not S7-1200) SCL V24_STAT_441 V24_SET_441 PRINT MODB_341 MODB_441 MODBUSCP MB_CPCLI MB_CPSRV Page 77 S7-400 S7-1500 S7-300 S7-1200 Basic instructions Extended instructions Technology Description ET 200S serial interface Receive data Send data Read accompanying signals at the RS 232 interface Write accompanying signals at the RS 232C interface Set data flow control using XON/XOFF Set data flow control using RTS/CTS Configure data flow control via automatic Configure operation of the RS 232C accompanying signals Modbus slave instruction for ET 200S 1SI Send data to a USS slave Receive data from a USS slave Initialize USS SIMATIC NET CP Open User Communication Passes data to the CP for transfer via a configured connection Passes jobs to the CP for accepting received data Locks data exchange via a connection with FETCH/WRITE A5E33284667-AA Communication LAD/FBD STL (not S7-1200) SCL Note: S stands for serial S_RCV S_SEND S_VSTAT S_VSET S_XON S_RTS S_V24 S_MODB S_USST S_USSR S_USSI AG_SEND AG_RECV AG_LOCK Page 78 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description Connection diagnostics Connection diagnostics Connection diagnostics, connection establishment, ping request Connection diagnostics, connection establishment, ping request PROFIBUS DP Data transfer to the CP as DP master or DP slave Data receipt from CP as DP master or DP slave Request of diagnostic information Transfer of control information to the PROFIBUS CP PROFINET IO Data passing to the CP as IO controller or IO device A5E33284667-AF Technology LAD/FBD Communication STL (not S7-1200) SCL AG_UNLOCK AG_CNTRL AG_CNTEX AG_CNTEX DP_SEND DP_RECV DP_DIAG DP_CTRL PNIO_SEND Page 79 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Technology Description Data receipt from CP as IO controller or IO device Read data record or write data record in IO controller Alarm evaluation through CP343-1 as IO controller PROFIenergy Triggering or ending an energy saving pause Extended triggering or ending of an energy saving pause Processing of the commands of the IO controller in the PROFIenergy device Transfer of the switch setting from power modules to ET 200S Other instructions Use of a logical trigger for ERPC communication Setup of FTP connections from and to an FTP server A5E33284667-AA Communication LAD/FBD STL (not S7-1200) SCL PNIO_RECV PNIO_RW_REC PNIO_ALARM PE_START_END_CP PE_CMD_CP PE_I_DEV_CP PE_DS3_Write_ET200_CP LOGICAL_TRIGGER FTP_CMD Page 80 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description GPRSComm:CP 1242-7 Establish connection via GSM network Terminate connection via GSM network Send data via the GSM network Receive data via the GSM network Transfer configuration data to CP S7-300C functions ASCII, 3964(R) Send data (ASCII, 3964(R)) Fetch data (ASCII, 3964(R)) Reset input buffer (ASCII, 3964(R)) RK 512 Send data (RK 512) Fetch data (RK 512) Receive and provide data (RK 512) A5E33284667-AF Technology Communication LAD/FBD STL (not S7-1200) SCL TC_CON TC_DISCON TC_SEND TC_RECV TC_CONFIG SEND_PTP_300C RCV_PTP_300C RES_RCVB_300C SEND_RK_300C FETCH_RK_300C SERVE_RK_300C Page 81 Extended instructions S7-1500 S7-400 S7-1200 S7-300 Basic instructions Description Communication with iSlave Technology Read data from a communication partner within the local S7 station Write data to a communication partner within the local S7 station Abort a connection to a communication partner within the local S7 station PROFINET CBA Update the inputs of the user program interface Update the outputs of the user program interface Release DP interconnections A5E33284667-AA LAD/FBD Communication STL (not S7-1200) SCL I_GET I_PUT I_ABORT PN_IN PN_OUT PN_DP Page 82 S7-1500 S7-400 S7-1200 S7-300 Basic instructions Extended instructions Description MPI communication Technology Send data to a communication partner outside the local S7 station Receive data from a communication partner outside the local S7 station Read data from a communication partner outside the local S7 station Write data to a communication partner outside the local S7 station Abort an existing connection to a communication partner outside the local S7 station TeleService Transfer email Establish remote connection to programming device/PC Establish remote connection to AS Send text (SMS) message Transfer email A5E33284667-AF LAD/FBD Communication STL (not S7-1200) SCL Note: X stands for the MPI interface X_SEND X_RCV X_GET X_PUT X_ABORT TM_MAIL PG_DIAL AS_DIAL SMS_SEND AS_MAIL Page 83 Appendix Optional instructions S7-400 S7-1200 S7-1500 S7-300 Appendix Optional instructions Description SIMATIC Ident Read data from transponder Read out data from code reading system Reset reader Set program at code reading system Write data to the transponder Status queries Read out status of the reader Read out status of the transponder Extended functions Load the configuration data to the reader Back up configuration data from the reader Detect transponder population Read out data of the TID memory of a transponder Read out UID of an HF transponder Switch on/off antenna of RF300 readers A5E33284667-AA LAD/FBD STL (not S7-1200) SCL Read Read_MV Reset_Reader Set_MV_Program Write Reader_Status Tag_Status Config_Download Config_Upload Inventory Read_TID Read_UID Set_ANT_RF300 Page 84 S7-300 S7-400 S7-1200 S7-1500 Appendix Optional instructions Set UHF parameters in the reader Write EPC ID of a UHF transponder Ident function for trained users with command transfer in a data structure Complex Ident function for experts with all commands and possibilities Legacy Read out data of the EPC memory of a transponder Write EPC memory of a UHF transponder Switch on/off antennas of RF620R/RF630R Reset MOBY D reader Reset MOBY U reader Reset MV code reading device Reset RF200 reader Reset RF300 reader Reset RF600 reader Reset function for experts allows universally adjustable parameters A5E33284667-AF Description LAD/FBD STL (not S7-1200) SCL Set_Param Write_EPC_ID Advanced_CMD Ident_Profile Read_EPC_Mem Write_EPC_Mem Set_ANT_RF600 Reset_MOBY_D Reset_MOBY_U Reset_MV Reset_RF200 Reset_RF300 Reset_RF600 Reset_Univ Page 85 S7-1500 S7-400 S7-1200 S7-300 Appendix Optional instructions Description Energy Suite Calculate operating-mode-related energy data of machines and systems for uniform efficiency evaluation according to measuring regulation Create efficiency protocol in CSV format on the SIMATIC memory card of the CPU according to measuring regulation A5E33284667-AA LAD/FBD STL (not S7-1200) SCL EnS_EEm_Calc EnS_EEm_Report Page 86 Siemens AG Digital Factory Postfach 48 48 90026 Nurnberg DEUTSCHLAND www.siemens.com/automation Anderungen vorbehalten. A5E33284667-AF (c) Siemens AG 2017