Berger step7 stl&scl-rus

776
Предисловие Краткий обзор содержания книги Краткий обзор содержания дискеты с примерами программ Автоматизация с применением STEP 7: схемы применения Содержание Введение Базовые функции Функции для обработки чисел Управление выполнением программы Выполнение программы Обработка переменных Структурированный язык управления SCL Приложения Предметный указатель Сокращения Демонстрационные программы для STEP 7 Ганс Бергер Автоматизация посредством STEP 7 с использованием STL и SCL и программируемых контроллеров SIMATIC S7- 300/400 Издание 2001

Transcript of Berger step7 stl&scl-rus

  • 1. STEP7: STEP 7 STL SCL SCL SIMATIC S7- 300/400 STEP 7 2001

2. , , . , : !, , , .! , , .! , . , , . , . . , , , . : ! , , , Siemens. , , , , . SIMATIC, SIMATIC HMI SIMATIC NET - SIEMENS AG. , , ; , .Copyright Siemens AG 2001 , . . , . . ,, , , , , .. Siemens AG. Siemens AG 2001 Technical data subject to change. 4848, D- 90327, Siemens Aktiengesellschaft 3. SIMATIC "" . , (SIMATIC S7), (SIMATIC M7) (SIMATIC C7). . S7-200 ("-PLC"), S7- 300 S7-400 . STEP 7, STEP 5, SIMATIC. Windows 95/98 Microsoft Windows NT Microsoft , STEP 7 ( , ""). STEP7 , DIN EN 6.1131-3: STL ("statement list" - , Assembler- ), LAD ("ladder diagram" - " ", ), FBD ("function block diagram" - " ", -) SCL ("Structured Control Language" " ", Pascal- ). , : S7-GRAPH ( SIMATIC ), S7-HiGraph ( SIMATIC ) CFC ("continuous function chart" - ; CFC FBD). .IIAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 4. , , STEP 7. STL S7-300/400. S7-300/400 STEP 7. STEP 7 , STEP 7 . STL , . , , . STL, ( ) . , , , , . SCL. SCL , SCL . STEP 7 SIMATIC S7- , . STEP 5 STEP 7, STL SCL. STEP 7 5.1, S7-SCL 5.1.Erlangen, 2001 (Hans Berger)Automating with STEP 7 in STL and SCLIII STEP STL SCL 5. - PLC , ,S7-300/400 - 1 SIMATIC S7-300/400 4 9 15 "" , AND (), OR "" ; PLC(), Exclusive OR INT, DINT EN/ENO(( );REAL S7-300/400); ;5 10 16 (PROFIBUS , ,DP); ; , INT, DINT RLO,(); ; REAL;BR, "" ; ;; / 2 -6 - 11 17 STEP 7 (MCR) Load ;MCR,; - Transfer; Arc-; MCR-, ; ; MCR- ; Symbol Editor ( ); 7 12 18 STL/ SCL; ; , - SIMATIC ; ; IEC-; - 3 S7- 8 13 19 SIMATIC-; ; ;/ ; STL/ SCL;/;14 ; DB; IEC-Word ; - ; ; AND (), OR () (), Exclusive OR ( )IVAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 6. S5/S7 , SCL , SCL 20 24 27 ,32 S5/S7- ; ; , , , ;; ( , ; 28 S5-;; ); ; UDTIF, CASE, FOR, WHILE, - REPEAT, CONTINUE, EXIT, GOTO, RETURN - ; - SFC SFB21 25 29 SCL33 ; SCL; ; DB; ; ; ANY; ; ; EN/ENO ; IEC- ; ; S5-S7 ( ; ); TI-S7 ;; , -;22 26 30 SCL-34 STL STL ;"", "" ; ; ;; STOP, HOLD, ; ; ; ; ; 23 ; 28 35 SCL- "" ; ANY; ; -; ;; STRING-; ; Date/TOD-; Automating with STEP 7 in STL and SCL V STEP STL SCL 7. , STL SCL. , . STL_BOOK SCL_BOOK. 2,7 1,6 ( PG). STL_BOOK , STL- . , (: [Conveyor Example]), ( [Message FrameExample]). . STL_BOOK STL- SFCFB 104 4: FB 120 20: FB 105 5: FB 121 21: FB 106 6: FB 122 22: FB 107 7: FB 123 23: FB 108 8: (Digital) STL- FB 109 9: FB 124 24: FB 110 10: FB 125 25: FB 111 11: FB 126 26: FB 112 12: FB 101 FB 113 13: FB 102 FB 114 14: Word FB 103 STL- FB 115 15: FC 11 FB 116 16: FC 12 FB 117 17: FB 20 FB 118 18: FB 21 FB 119 19: FB 22 ( 3) FC 41 FC 42 UDT 51 , FC 43 UDT 52 , FC 44 DOUBLEFB 51 WORDFB 52 FC 45 FC 61 S5 REAL S7FC 62 FC 46 REAL S7FC 63 S5 FC 47 ( ANY)VIAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 8. SCL_BOOK SCL SCL-. , STL- :" " [Conveyor Example] [Message Frame Example], SCL_BOOK SCL-. "General Examples" (" ") SCL- , SCL STL- SCL-. SCL_BOOK SCL- SL- ( 27) SL- ( 30)FC 271 FB 301 OB 1 FB 302 FB 303 FB 271 , , FB 304 FB 272 FB 305 SL- ( 28) SL- ( 31)FB 281 IFFB 311 FB 282 CASEFB 312 FB 283 FOR FB 313 StringFB 284 WHILE FB 314 Date/TODFB 285 REPEATFB 315 SCL- SL- ( 29)FC 61 DT_TO_STRINGF 291 FC FC 62 DT_TO_DATEF 292 FC FC 63 DT_TO_TODFB 291 FB FB 61 FB 292 FC FB FB 62 F 293 FC EN/ENOFB 63 FB 293 FB EN/ENOFB 64 FIFO FB 294 EN/ENOSTL SCL FC 11 UDT 51 , FC 12 UDT 52 , FB 20 FB 51 FB 21 FB 52 FB 22 FC 61 , , , , , . -, . STEP 7 STEP 7Mini, -, - STEP 7 (. ).Automating with STEP 7 in STL and SCLVII STEP STL SCL 9. STEP 7: , , () STEP 7. SIMATIC Manager, . . , ( Windows) , CPU. . . , , . . . : (), ; () , ( ) . , SIMATIC Manager.VIIIAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 10. SIMATIC Manager ? Hardware (,CPU) - CPU c DP Master(CPU with DP Master): PROFIBUS, DP-Proect ( Hardware ) CPU(Master) DP ,, (Slave) DP- - System Data[ ]Automating with STEP 7 in STL and SCLIX STEP STL SCL 11. , "" CP (UDT) DB " " FC FB, DB OB Blocks System Data [] [ ]X Automating with STEP 7 in STL and SCL STEP 7 STL SCL 12. (online) , CPU PGAutomating with STEP 7 in STL and SCL XI STEP STL SCL 13. 1-11 SIMATIC S7-300/400 1-31.1 1-31.1.1 1-31.1.2 S7-3001-41.1.3 S7-4001-61.1.4 CPU1-81.1.5 1-101.1.6 1-101.2 I/O (/)1-111.2.1 DP- 1-121.2.2 DP- (DP Master)1-131.2.3 DP- (DP Slaves)1-131.2.4 PROFIBUS-PA1-151.2.5 AS-1-161.2.6 1-181.3 (communications)1-181.3.1 1-181.3.2 1-201.3.3 (communications services)1-241.3.4 (connections) 1-251.4 1-261.4.1 1-261.4.2 1-271.4.3 1-271.4.4 1-281.4.5 1-291.5 1-291.5.1 1-291.5.2 ( )1-311.5.3 1-32XII Automating with STEP 7 in STL and SCL STEP 7 STL SCL 14. 2 STEP 7 2-12.1 STEP 7 (STEP 7 Basic Package)2-12.1.1 2-12.1.2 2-22.1.3 SIMATIC Manager2-22.1.4 (Project(s) Library(ies)) 2-62.1.5 (Online Help )2-72.2 2-82.2.1 2-82.2.2 , 2-102.2.3 (Project Versions) 2-112.3 2-132.3.1 2-152.3.2 2-152.3.3 2-162.3.4 MPI2-172.3.5 Monitor () Modify () 2-182.4 (Network) 2-182.4.1 (Network View) 2-202.4.2 DP- Network Configuration 2-212.4.3 (Connections) 2-222.4.4 (Network Transitions)2-272.4.5 (Loading the Connection Data) 2-282.5 S7-2-292.5.1 2-292.5.2 (Symbol Table) 2-302.5.3 STL- (STL Program Editor)2-322.5.4 SCL- (SCL Program Editor)2-372.5.5 (Rewiring) 2-402.5.6 (Address Priority)2-412.5.7 (Reference Data) 2-422.5.8 2-442.6 (Online Mode) 2-462.6.1 PLC 2-462.6.2 2-472.6.3 CPU (CPU Information)2-492.6.4 CPU 2-49Automating with STEP 7 in STL and SCLXIII STEP 7 STL SCL 15. 2.6.5 (Block Handling) 2-502.7 2-522.7.1 2-532.7.2 STOP 2-532.7.3 (Monitoring and Modifying Variables)2-542.7.4 (Forcing Variables) 2-562.7.5 ( Enable peripheral outputs) 2-592.7.6 "Program Status" (" ") STL2-602.7.7 SCL-2-623 SIMATIC S7- 3-13.1 3-13.1.1 3-13.1.2 3-33.1.3 3-43.2 3-53.2.1 (Block Types)3-63.2.2 (Block Structure) 3-83.2.3 (Block Properties) 3-83.2.4 (Block Interface)3-133.3 (Addressing Variables) 3-153.3.1 3-163.3.2 3-183.3.3 3-183.4 STL3-203.4.1 STL- 3-203.4.2 STL 3-213.4.3 STL, 3-243.5 SCL3-283.5.1 SCL- 3-283.5.2 SCL- 3-303.6 3-353.6.1 3-353.6.2 , 3-37XIVAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 16. 3.7 3-393.7.1 3-393.7.2 3-413.7.3 3-413.7.4 3-423.7.5 3-45 4-14 4-34.1 4-34.2 4-74.2.1 AND ()4-84.2.2 OR ()4-104.2.3 Exclusive OR ( )4-104.2.4 , 4-114.3 4-134.4 4-144.4.1 ( )4-144.4.2 AND- () OR ()4-164.4.3 OR () Exclusive OR ( ) AND () 4-174.4.4 AND () Exclusive OR ( )4-184.4.5 OR () Exclusive OR ( )4-184.4.6 4-195 (memory functions)5-15.1 Assign ()5-15.2 Set ( ) Reset ( )5-35.3 RS Flipflop (RS-) 5-45.3.1 Reset( ) 5-45.3.2 Set( ) 5-55.3.3 5-55.4 Edge Evaluation ( )5-75.4.1 5-8Automating with STEP 7 in STL and SCLXV STEP 7 STL SCL 17. 5.4.2 5-105.4.3 5-105.4.4 5-125.4.5 (Binary Scaler)5-125.5 5-146 (move functions) 6-16.1 6-16.2 Load ( )6-46.2.1 Load6-46.2.2 6-66.2.3 6-76.3 Transfer ( )6-76.3.1 Transfer6-76.3.2 6-86.4 (Accumulator Functions) 6-96.4.1 6-106.5 accumulator 16-126.6 6-126.6.1 6-136.6.2 6-146.6.3 6-156.6.4 STRING 6-167 (timer functions)7-17.1 7-27.1.1 7-27.1.2 7-27.1.3 (Resetting a timer) 7-47.1.4 (Enabling a timer)7-57.1.5 () (Checking a timer) 7-57.1.6 7-77.1.7 ( ) 7-87.2 (Pulse timer)7-87.3 (Extended pulse timer)7-127.4 (On-delay timer)7-157.5 (Retentive On-delay timer)7-197.6 (Off-delay timer)7-23XVI Automating with STEP 7 in STL and SCL STEP 7 STL SCL 18. 7.7 IEC- (IEC Timer Functions)7-267.7.1 SFB 3 TP7-287.7.2 SFB 4 TON 7-287.7.3 SFB 5 TOF7-298 (ounter functions)8-18.1 8-28.2 (Counting)8-38.3 () (Checking a Counter) 8-48.4 (Enabling a counter)8-58.5 8-88.6 IEC- (IEC Counter Functions)8-98.6.1 SFB 0 CTU 8-108.6.2 SFB 1 CTD 8-118.6.3 SFB 2 CTUD8-118.7 8-12 9-19 9-39.1 9-49.2 9-59.3 9-810 10-110.1 10-210.2 INT 10-310.3 DINT10-510.4 REAL10-610.5 10-810.6 Accumulator 1 10-1010.7 10-1111 11-111.1 11-111.2 11-211.3 (Arc-) 11-311.4 11-4Automating with STEP 7 in STL and SCLXVII STEP 7 STL SCL 19. 12 12-112.1 12-212.2 INT DINT 12-312.3 BCD 12-412.4 REAL12-512.5 12-713 13-113.1 13-213.2 13-413.3 13-714 (Word Logic)14-114.1 14-114.2 14-4 15-115 (Status Bits) 15-315.1 15-315.2 15-715.3 15-1015.4 ( BR)15-1216 16-116.1 16-216.2 16-316.3 RLO BR 16-316.4 CC0 CC116-516.5 OV OS16-816.6 (Jump Distributor)16-916.7 (Loop Jump) 16-1017 MCR 17-117.1MCR- (MCR Dependency) 17-217.2MCR- (MCR Area) 17-317.3MCR- (MCR Zone)17-417.4 (I/O )17-6XVIII Automating with STEP 7 in STL and SCL STEP 7 STL SCL 20. 18 (Block Functions)18-118.1 18-118.1.1 : 18-218.1.2 CALL 18-318.1.3 UC CC 18-418.1.4 (Block End Functions)18-618.1.5 18-618.1.6 18-1018.2 18-1418.2.1 18-1518.2.2 18-1618.2.3 18-1918.2.4 18-2018.2.5 18-2118.2.6 , 18-2118.3 18-2418.3.1 18-2518.3.2 18-2518.3.3 18-2518.4Null- (-)18-2618.4.1 NOP 18-2618.4.2 BLD18-2619 19-119-1 : 19-119-1.1 19-119-1.2 19-119-1.3 (declaration) 19-219-1.4 (declaration) 19-519-1.5 (Initialization) 19-619-2 19-619-3 19-1119-4 ("Pass On") 19-1619-519-1719.5.1 : 19-1719.5.2 : 19-1919.5.3 : 19-20Automating with STEP 7 in STL and SCLXIX STEP 7 STL SCL 21. 20-120 (main program) 20-320.1 20-320.1.1 20-320.1.2 20-520.2 20-820.2.1 20-820.2.2 20-1020.2.3 ("background scanning")20-1220.2.4 ("Response Time")20-1420.2.5 ("Start Information") 20-1520.3 (Program Functions)20-1720.3.1 (Real-Time Clock)20-1720.3.2 (System Clock)20-1820.3.3 (Run-Time Meter)20-1920.3.4 CPU (Compressing CPU Memory)20-2020.3.5 20-2120.3.6 20-2120.4 (ommunications) I/O 20-2220.4.1 (I/O) 20-2420.4.2 (I/O)20-3020.4.3 (I/O) 20-4520.5 20-4920.5.1 20-4920.5.2 GD- 20-5320.5.3 GD-20-5620.6 SFC- 20-5720.6.1 (Station-Internal) SFC-20-5720.6.2 20-5920.6.3 (Station-External) SFC- 20-6120.6.4 ("" SFC) 20-6320.7 SFB- 20-6720.7.1 20-6720.7.2 (Two-way Data Exchange) 20-7020.7.3 (One-way Data Exchange)20-73XXAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 22. 20.7.4 (Print Data)20-7420.7.5 (Control Functions) 20-7520.7.6 (Monitoring Functions) 20-7721 21-121.1 21-121.2 (Hardware Interrupts)21-421.2.1 21-421.2.2 21-521.2.3 STEP 7 21-621.3 (watchdog Interrupts) 21-621.3.1 (watchdog Interrupts)21-721.3.2 (watchdog Interrupts) STEP 721-921.4. (time-of-day interrupts)21-1021.4.1 (time-of-day interrupts) 21-1021.4.2 (time-of-day interrupts) STEP 721-1221.4.3 (time-of-day interrupts) 21-1321.5. c (time-delay interrupts)21-1521.5.1 c (time-delay interrupts) 21-1521.5.2 c (time-delay interrupts) STEP 7 21-1721.5.3 c (time-delay interrupts)21-1721.6 21-1921.7 21-2122 22-122.1 22-122.1.1 22-122.1.2 HOLD ()22-222.1.3 (disable) 22-322.1.4 22-422.2 (Power-Up) 22-522.2.1 STOP () 22-522.2.2 (Memory Reset) 22-622.2.3 (Retentivity) 22-6Automating with STEP 7 in STL and SCL XXI STEP 7 STL SCL 23. 22.2.4 22-722.3 22-822.3.1 (START-UP) 22-822.3.2 "" (Cold Restart) 22-922.3.3 "" (Complete Restart)22-1122.3.4 "" (Warm Restart)22-1222.4 22-1322.5 22-1523 23-123.1 23-223.2 23-323.2.1 23-323.2.2 23-623.2.3 23-623.2.4 23-723.2.5 "" ( - Substitute Value) 23-723.3 23-823.4 23-1223.4.1 23-1223.4.2 23-1323.4.3 23-1423.4.4 23-15 24-124 24-324.1 24-324.1.1 24-324.1.2 BOOL, BYTE, WORD, DWORD, CHAR24-424.1.3 24-624.1.4 24-924.2 24-1124.2.1 DATA_AND_TIME24-1224.2.2 STRING 24-1324.2.3 ARRAY24-1524.2.4 STRUCT 24-1724.3 24-20XXII Automating with STEP 7 in STL and SCL STEP 7 STL SCL 24. 24.3.1 , (UDT)24-2024.3.2 UDT 24-2125 25-125.1 25-125.1.1 (area pointers) 25-225.1.2 DB (DB pointers)25-225.1.3 ANY- (ANY pointer)25-425.2 STL25-525.2.1 25-625.2.2 (Indirect Addresses) 25-725.2.3 (memory-indirect addressing) 25-825.2.4 (Register-Indirect Area-Internal Addressing)25-1025.2.5 (Register-Indirect Area-Crossing Addressing)25-1125.2.6 25-1225.3 25-1325.3.1 25-1425.3.2 25-1525.3.3 25-1525.3.4 25-1625.4 25-1825.4.1 AR125-1825.4.2 AR225-1825.4.3 25-2026 26-126.1 26-126.2 26-426.2.1 26-426.2.2 26-626.2.3 26-626.3 26-826.3.1 26-826.3.2 26-1126.3.3 "" ANY- (ANY-pointer)26-13Automating with STEP 7 in STL and SCLXXIII STEP 7 STL SCL 25. 26.4 "Message Frame Example" ( ) 26-16 SCL27-127 . 27-327.1 SIMATIC 27-327.1.1 ()27-327.1.2 27-427.1.3 SCL- 27-427.1.4 (Symbol Table) 27-527.1.5 SCL- 27-727.1.6 SCL-27-727.1.7 SCL-27-727.1.8 27-827.1.9 (Data Type Veiws) 27-1027.2 27-1227.2.1 27-1227.2.2 27-1327.2.3 SCL 27-1327.3 27-1527.4 27-1627.4.1 27-1727.4.2 27-1727.4.3 27-1927.5 27-2027.5.1 27-2027.5.2 DT STRING27-2027.5.3 27-2127.5.4 27-2128 (Control Statements)28.128.1 IF28.128.2 CASE28.328.3 FOR 28.428.4 WHILE 28.528.5 REPEAT28.628.6 CONTINUE28.728.7 EXIT28.8XXIV Automating with STEP 7 in STL and SCL STEP 7 STL SCL 26. 28.8 RETURN28.828.9 GOTO28.929SCL-29-129.1SCL-: 29-129.2 SCL-29-229.2.1 FC 29-329.2.2 FC 29-329.2.3 FB29-429.2.4 29-529.2.5 29-729.2.6 29-829.2.7 29-929.3 SCL-29-1029.3.1 FC 29-1129.3.2 FC 29-1129.3.3 29-1229.3.4 29-1329.3.5 29-1429.4 EN/ENO 29-1529.4.1 -29-1529.4.2 ENO (ENO output) 29-1629.4.3 EN (EN input) 29-1730. SCL-30-130.1 30-130.2 30-230.3 30-430.4 (Shifting) (Rotating) 30-530.5 (Conversion Functions)30-630.5.1 (Implicit Conversion Functions)30-730.5.2 (Explicit Conversion Functions)30-830.6 SCL30-830.7 STL 30-1330.8 SCL 30-1530.8.1 "Conveyor" ("") 30-1530.8.2 30-1630.8.3 30-16Automating with STEP 7 in STL and SCL XXV STEP 7 STL SCL 27. 31 IEC- 31-131.1 (Conversion Functions) 31-231.2 (Comparison Functions)31-431.3 STRING (STRING Functions) 31-831.4 Date/Time-of-Day (Date/Time-of-Day Functions) 31-1131.5 (Numerical Functions)31-1432-132 S5/S7- 32-332.1 32-332.2 32-532.2.1 (PLC)32-532.2.2 32-632.2.3 32-832.2.4 32-1032.3 32-1132.3.1 32-1132.3.2 32-1332.3.3 32-1332.3.4 32-1432.4 32-1732.4.1 STEP 732-1732.4.2 32-1832.4.3 32-1932.4.4 32-1932.4.5 " " 32-2132.4.6 32-2132.4.7 32-2332.4.8 32-2332.4.9 32-2333 33-133.1 ()33-133.2 (SFB)33-333.3 IEC-33-933.4 S5-S7- 33-1133.5 TI-S7- 33-15XXVIAutomating with STEP 7 in STL and SCL STEP 7 STL SCL 28. 33.6 - 33-1633.7 33-1634 STL-34-134.1 34-234.1.1 34-234.1.2 34-334.1.3 34-334.1.4 34-434.1.5 34-534.2 34-534.2.1 34-534.2.2 34-534.2.3 34-634.2.4 34-634.2.5 34-734.2.6 34-734.3 34-834.3.1 34-834.3.2 MCR 34-934.3.3 34-934.4 34-1035 SCL- 35-135.1 35-135.2 35-235.3 35-235.4 CSL 35-335.4.1 35-335.4.2 35-435.4.3 35-535.4.4 35-635.4.5 35-7 36-137-1 STEP 7 38-1Automating with STEP 7 in STL and SCLXXVII STEP 7 STL SCL 29. SIMATIC S7-300/400. SIMATIC S7-300/400 . , , ( CPU) . SIMATIC S7 / (I/O) . CPU, , . (load memory) : , ( ), (work memory), , .STEP 7 S7-300/400. , SIMATIC Manager. SIMATIC Manager , Windows 95/98/NT , . SIMATIC Manager , , , . , STEP 7. SIMATIC S7 , , , , . .STEP 7 , (BOOL), (INT REAL) , ( ).Automating with STEP 7 in STL and SCL1- 1 STEP 7 STL SCL 30. S7-300/400. STEP 7 . STEP 7 5.1. 3 " SIMATIC S7" S7- STL SCL. STL SCL . . 1 SIMATIC S7-300/400 ; (I/O); ; ; . 2 STEP 7 SIMATIC Manager; ; ; ; ( , ); ; . 3 SIMATIC S7 ; ; ; STL SCL; ; ( ).1- 2 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 31. 1. SIMATIC S7-300/4001 SIMATIC S7-300/4001.1 1.1.1 SIMATIC S7-300/400 : (Rack): . (PS "power supply"): . (CPU "central processing unit"): . (IM "interface module"): . (SM "signal module"): , , . (FM "function module"): CPU, . (CP "communication processor"): . : . ( ) , . , CPU I/O ( SM, FM CP) . I/O I/O , , (. . 1). / (. 1.2, " I/O").Automating with STEP 7 in STL and SCL 1- 3 STEP 7 STL SCL 32. 1. SIMATIC S7-300/400 : / (I/O P-) ( K-). I/O- , . CPU (MPI) .1.1.2 S7-300 S7-300 8 / . , CPU 314 : , ( IM 365 ); , 4 , .. , 3 ( IM 360 IM 361 ). . , 1.2 ( CPU 312 IFM 0.8 ). , P- K-. FM 356 M7-300. FM-356 "" , " " . , . SIMATIC SIMATIC S7-300 . : (-25+60), , IEC 68 2-6; , IEC 721-3-3 Class 3 K5, / EN 50155 ( ). . 1- 4Automating with STEP 7 in STL and SCL STEP 7 STL SCL 33. 1. SIMATIC S7-300/400 S7-300 : IM 460-1 IM 460-0 S7-400 IM 460-3 IM 463-2 5 ; : 1.5 (IM 461-1) 5 ; : 3 (IM 461-0) 5 ; : 100 (IM 461-3) S5-; : 600 (IM 314). 1.1 S7-300/400Automating with STEP 7 in STL and SCL 1- 5 STEP 7 STL SCL 34. 1. SIMATIC S7-300/4001.1.3 S7-400 S7-400 : 18 9 ( UR1 UR2), CPU, ( ). IM 460-1 IM 461-1 5- 1.5 . , IM 460-0 IM 461-0 4 3 . , IM 460-3 IM 461-3 4 100 . 21 . . P- K-. ER1 ER2 ( 18 9 ) "" , , 24- P-, K- . K- UR1, UR2 CR2 , 1 6. CR2. CR2 . CPU , P- , K-. S7-400 ( ) CPU. CPU ( ). 20.3.6 " " 21.6 " ". 1- 6Automating with STEP 7 in STL and SCL STEP 7 STL SCL 35. 1. SIMATIC S7-300/400 SIMATIC S5 IM 463-2 S7-400 SIMATIC S5 (EG 183U, EG 185U,EG 186U, ER 701-2 ER 701-3), . IM 314 SIMATIC S5 . , . S7-400 IM 463-2; IM 463-2, , S5 . SIMATIC S7-300/400, , . "", , . , ,"" . , , . / (I/O) (ET 200M IM 153-3 PROFIBUS-DP). () ("Software Redundancy"). SIMATIC S7-400HSIMATIC S7-400H , , H CPU - . ""; ./ (, ) ( ET 200M). . , ; . () "S7-400H".Automating with STEP 7 in STL and SCL1- 7 STEP 7 STL SCL 36. 1. SIMATIC S7-300/4001.1.4 CPU 1.2 CPU, . , (load memory) (work memory). (load memory) CPU . , , (load memory) . (work memory) CPU RAM-. : . "" , , , . (CPU) I/O ( (offline)) ( (offline)) () - CPU S7-400 () . 1.2 CPU1- 8 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 37. 1. SIMATIC S7-300/400 , , (load memory). CPU "" (. ) (work memory). CPU, (load memory) (work memory) ( . 2.6.4 " CPU" 2.6.5" "). (load memory) RAM-, , CPU. (loadmemory) EEPROM- EPROM -, CPU . (load memory) CPU 3xxIFM RAM EEPROM. RAM- , EEPROM-, . (load memory) CPU S7-300 ( CPU318) RAM-, . EPROM - , . CPU S7-300 ( ) (, , ) . . RAM- CPU S7-400 . , (load memory), RAM- . EPROM - . CPU S7-400 (work memory) . STEP 7 V5.1, CPU S7-400, (load memory) CPU (. 2.2.2", ").Automating with STEP 7 in STL and SCL1- 9 STEP 7 STL SCL 38. 1. SIMATIC S7-300/4001.1.5 : RAM- EPROM -. (load memory), RAM- (, CPU S7-400). RAM- . , RAM- . - , , EPROM -. , EPROM - . CPU , EPROM - CPU.1.1.6 (), . ( ), , CPU, . , , , , , () . CPU : (I): " " . (Q): " " . (M): , . (): , . (): . 1- 10 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 39. 1. SIMATIC S7-300/400 (L) . L-, CPU ., , , . . ( ). , , S7-400 .1.2 I/O (/) PROFIBUS-DP "" . " " " DP-" (DP-master), "DP-" (DP-slave). / (I/O) , PROFIBUS-DP PROFIBUS. PROFIBUS-DP EN 50170 DP-. 1.3.2 "". DP- DP- " DP-" (DP-master system). 32 127 . DP- , DP-. PROFIBUS-DP , ,, - , ET 200 DP- SIMATIC S5.Automating with STEP 7 in STL and SCL 1- 11 STEP 7 STL SCL 40. 1. SIMATIC S7-300/4001.2.1 DP- DP- (mono master system) PROFIBUS-DP DP- ("mono master system"); DP- DP-. DP- , , . DP- DP- " DP-" ("DP-master system") (. . 1.3). S7- DP-, , CPU 318-2DP, ,ET 200B PROFIBUS-DP DP/PA , , (DP/PA link) ET 200MPROFIBUS-PA , DP/RS232C (link), CPU 315-2DPDP/PA (DP/PA coupler) PROFIBUS-PA DP/AS- (DP/AS-Interface link)AS- . 1.3 DP- (DP-master system) 1- 12Automating with STEP 7 in STL and SCL STEP 7 STL SCL 41. 1. SIMATIC S7-300/400 DP- (multi master system) PROFIBUS-DP DP- ("multi master system"). , DP-; , , DP- "" DP-, DP- "" DP- . . DP- , DP- DP-. S7- DP-, DP- . CPU " DP-".1.2.2 DP- (DP Master) DP- (DP Master) PROFIBUS. "" DP-. DP- : CPU DP- (, CPU 315-2DP, CPU 417). CPU (, IM 467). CP CPU (, CP 342-5, CP 443-5). " DP- 1 ", , " DP- 2", (,).1.2.3 DP- (DP Slaves) DP- (DP Slaves) PROFIBUS. SIMATIC S7 DP-: , DP-. , (). , .Automating with STEP 7 in STL and SCL1- 13 STEP 7 STL SCL 42. 1. SIMATIC S7-300/400 PROFIBUS DP- DP- : ET 200B ( / / , IP 20 , 12 /); ET 200C ( , IP 66/67, / / , , 1,5 / 12 /); ET 200L-SC (- / / , IP 20 , 1,5 /); , DP/AS-I (DP/AS-I Link), DP- PROFIBUS-DP. PROFIBUS DP- DP- ET 200M. S7-300, DIN, , IM 153 CPU 8 (SM) (FM). 9,6 / 12 /). ET 200M , DP- S7-400. , / S7-300 , . . , .. . ET 200M IM 153-3 DP- . IM 153- 3 : - DP- () - DP- . PROFIBUS DP- () DP- S7-300, CPU DP- , (slave) ( , CPU 315-2DP), S7-300 CP 342-5 (slave) . 1- 14Automating with STEP 7 in STL and SCL STEP 7 STL SCL 43. 1. SIMATIC S7-300/400 DP- ET 200X BM 147/CPU. 7 . "" "" BM 147/CPU, S7- . / / , (load feeders), 400 5,5 . 9,6 / 12 /.1.2.4 PROFIBUS-PAPROFIBUS-PAPROFIBUS-PA ("Process Automation" [ ]) ( Ex-, , , ), (, ). PROFIBUS-PA EN 50170, 2(PROFIBUS-DPA); IEC 1158-2. PROFIBUS-DP PROFIBUS-PA: DP/PA (DP/PA coupler), , PROFIBUS-DP , 45,45 /. DP/PA (DP/PA link), PROFIBUS-DP PROFIBUS-PA.DP/PA (DP/PA coupler)DP/PA (DP/PA coupler) PA- PROFIBUS-DP. PROFIBUS-DP DP/PA DP- , 45,45 /. DP/PA 31 PA- . "" PROFIBUS-PA , 31,25 /. PROFIBUS-PA PROFIBUS-PA (shared).DP/PA : DP/PA -Ex 400 DP/PA Ex 100 .Automating with STEP 7 in STL and SCL 1- 15 STEP 7 STL SCL 44. 1. SIMATIC S7-300/400DP/PA (DP/PA link)DP/PA (DP/PA link) PA- PROFIBUS-DP 9,6/ 12 /. DP/PA IM 157 5 DP/-, () SIMATIC S7. , PROFIBUS-PA, PROFIBUS-PD . DP/PA 31 PA- .SIMATIC DPMSIMATIC DPM (Process Device Manager [ ], : "SIPROM") , , , PROFIBUS-PA HART (Highway Addressable RemoteTransducers [ -]). - DDL (Device Description Language [ ]). SIMATIC DPM "" , Windows 9x/NT, STEP 7.1.2.5 AS-AS-AS- ("Actuator-Sensor Interface" ("AS-i") [ -]) . AS-i , 31 AS-i. AS-i-, , . AS-i AS-i , 8 ("normal" - "") . AS-i 100 , ( AS-i ) ( AS-i , AS-i). 1- 16Automating with STEP 7 in STL and SCL STEP 7 STL SCL 45. 1. SIMATIC S7-300/400 AS-i (AS-i master) AS-i (AS-i master) AS-i , 5 . AS-i SIMATIC S7 CP 342-2 PROFIBUS-DP DP/AS- (. . 1.4). DP/AS-i P 342-2 PROFIBUS-DP S7-300 DP/AS- (DP/AS-Interface link):AS- DP/AS-i DP/AS-iDP/AS-i DP/AS-i DP/AS-i (DP/AS-i distributor) 4 8 / DP/AS-i AS-i ASIC AS-i ASIC. 1.4 SIMATIC S7 AS-i CP 342-2 AS-i S7-300 ET 200M. : CP 342-2 / . 16 16 ( 256). AS-i CP, . AS-i. FC, ( , / , ).DP/AS- (DP/AS-Interface link) AS-i AS-i PROFIBUS-DP. PROFIBUS-DP DP-, AS- AS-i, 31 AS-i . AS-i DP/AS- 16 16 . - 12 /.Automating with STEP 7 in STL and SCL 1- 17 STEP 7 STL SCL 46. 1. SIMATIC S7-300/400DP/AS- : ( 65) IP 66/67 ( 20) IP 20 , 20 .1.2.6 PROFIBUS-DP/RS 232C (PROFIBUS-DP/RS 232C link) RS 232C (V.24) PROFIBUS-DP. DP/RS 232C RS 232C PROFIBUS-DP. DP/RS 232C 3964R ASCII. DP/RS 232C " ". . 224 . PROFIBUS-DP 12 /; RS 232C 38,4 / , , 8 1-.1.3 (ommunications) - SIMATIC S7. . - CPU. CP ( SIEMENS) .SIMATIC NET - , SIMATIC. SIMATIC NET , HMI (-). SIMATIC .1.3.1 1.5 . SIMATIC ( SIEMENS) . . SIMATIC S7 CPU MPI , . , (CP), . 1- 18Automating with STEP 7 in STL and SCL STEP 7 STL SCL 47. 1. SIMATIC S7-300/400 . - ( ). "" (" "), (""). , S7- S7- . SIMATIC S7 SIMATIC S7CPU CPU ID - ID - DB SFB DBSFBIDIDSDRD --- - - - - (Subnet) . 1.5 SIMATIC S7 - . , . , , ; , . SIMATIC : MPI, PROFIBUS, Industrial Ethernet PTP ("point-to-point" [ " "]). (communications service) (communications service) , , . , .Automating with STEP 7 in STL and SCL1- 19 STEP 7 STL SCL 48. 1. SIMATIC S7-300/400 SIMATIC : S7, PROFIBUS-DP, PROFIBUS-FMS, PROFIBUS-FDL(SDA), ISO transport, ISO-on-TSP . (connection) ( ). () , , , (,) . SIMATIC : S7-, S7- (), "point-to-point" [" "], FMS- FDL-, "ISO transport"-, "ISO-on-TSP"- TSP-, UDP- E-mail-. (communications functions) . SIMATIC S7 CPU . ( Siemens) . 1.1 , .1.3.2 - . SIMATICManager. : MPI SIMATIC . PROFIBUS ; /. Industrial Ethernet PLC . PTP (" ") . 1- 20Automating with STEP 7 in STL and SCL STEP 7 STL SCL 49. 1. SIMATIC S7-300/400 1.1 , MPI CPU (GD) GD- SFC SFC SFB , ( S7-400) SFBPROFIBUS CPU PROFIBUS-DP DP-( ) , /, SFC SFC SFC IM 467PROFIBUS-DP ( ) , /, SFC SFC SFC CP 342-5PROFIBUS-FDL,NCM, CP 443-5PROFIBUS-DP ,Extended ( ) SEND / RECEIVE () SFC SFC SFB , ( S7-400) SFB CP 343-5PROFIBUS-FMS,NCM, FMS- CP 443-5PROFIBUS-FDL ,Basic SEND / RECEIVE () SFC SFC SFB , ( S7-400) SFBIndustrial CP 343-1 ISO NCM,Ethernet CP 443-1TCP / IP ,SEND / RECEIVE SFB , ( S7-400) SFB CP 343-1 IT ISO NCM, CP 443-1 IT TCP / IP , IT- SEND / RECEIVE SFB , ( S7-400) SFBNCM - CP; NCM PROFIBUS Industrial Ethernet. STEP 7 V.5 SIMATIC S7 , , , . () S7 .MPI CPU ("multipoint interface", MPI [" "]). CPU, PG, HMI (- ) Siemens.Automating with STEP 7 in STL and SCL 1- 21 STEP 7 STL SCL 50. 1. SIMATIC S7-300/400 MPI : " " - . 50 . 1100 RS485 100 (optical link modul). 187,5 /. 32 . . ( "token passing" [ ""]). MPI CPU : , SFC SFB. .PROFIBUS PROFIBUS ("PROcess FIeldBUS") " ". PROFIBUS , EN 50170, . PROFIBUS : " " - . ; 100 (12 /) 1000 (9,6 /). (optical link modul). 127 . . . ( "token passing" [ ""]). (slaves) (master), , . . PROFIBUS; PROFIBUS-DP. CPU DP- . PROFIBUS SFC SFB. CP PROFIBUS-FMS PROFIBUS-FDL. (FMS- SEND/RESEIVE-). 1- 22Automating with STEP 7 in STL and SCL STEP 7 STL SCL 51. 1. SIMATIC S7-300/400Industrial EthernetIndustrial Ethernet - IEEE 802.3. Industrial Ethernet , " " ("industrial") - . 1,5 , 4,5 . 10 /. Industrial Ethernet 1000. , , , . , , , , ( "CSMA/CD"). . Industrial Ethernet : S7- SFB. Industrial Ethernet CP, ISO transport ISO-on-TCP, SEND/RESEIVE.Point-to-point " " ("Point-to-point", PTP) . "point-to-point" SIMATIC Manager. . RS 232C (V.24), 20 (TTY) RS422/485. 20 300/ 19,2 /, RS 232C RS 422/485 - 76,8 /. ; 10 RS 232C, 1000 20 9,6 / 1200 RS 422/485 19,2 /.3964 (R), RK 512, ASCII (), . .AS-AS- ("AS-Interface", AS-i) IEC TG 178 AS- c . AS- SIMATICManager; AS-i (AS-I master) .Automating with STEP 7 in STL and SCL1- 23 STEP 7 STL SCL 52. 1. SIMATIC S7-300/400 AS-Interface " ", ( ). 300 . 167 /. AS-I (master) 31 (slave) .1.3.3 (communications services) , . , : S7- - SIMATIC. S7- CPU, () , HMI . : (PG):, ; PG ,, "monitorvariables" . - (HMI): (OP), , / . SFB- (SFB-communications): ; SFB ; , . SFC- (SFC-communications): 76 ; SFC ; , . S7- MPI, PROFIBUS Industrial Ethernet. (Global data communications) CPU . . "" ( ); . . MPI- -. 1- 24 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 53. 1. SIMATIC S7-300/400 PROFIBUS-DP . " " EN 50170 2. , SIMATIC S7 PROFIBUS. PROFIBUS-FMS (Fieldbus Message Specification [" "]) (FMS-) EN 50170 2. PROFIBUS. PROFIBUS-FDL (Fieldbus Data Link [" "]) SDA (Send Data withAcknowledge [" "]) EN 50170 2. . PROFIBUS , , SIMATIC S5. ISO transport ISO 8073 Class 4. . ISO transport ,, SIMATIC S5 IndustrialEthernet. ISO-on-TSP TCP/IP RFC 1006. Industrial Ethernet.1.3.4 (connections) - . ; ("Communications via non-configured connections" - " "). . (connection table). ("Communications via configuredconnections"- " "). . "Connection type" (" ") (. 2.4 " "). (GD) PROFIBUS-DP SFC- (SFC-communications) S7-. GD GD; PROFIBUS-DP SFC- .Automating with STEP 7 in STL and SCL1- 25 STEP 7 STL SCL 54. 1. SIMATIC S7-300/400 (Connection resources) - "" CP. , , S7 MPI- CPU, CPU; MPI- CP () CP CPU. CPU . PG ( ). "" (SFC-).1.4 1.4.1 PLC (. . 1.6). +HP01 -S10 I/O 0 n0 40 1 2 3 4 5 6 7 4 5 7 7 0 n+10 5 7 7 I 5DI 164 "Switch BOOLI 5.2 motor on"A"Switch motor on" / A I 5.2/ 1- 26 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 55. 1. SIMATIC S7-300/400 , , +HP01-S10, ("Switch motor on" - " "), , . "", I/O- (, 5, 2). CPU " ", ("input") (, I 5.2). "I 5.2" . - , (, "Switch motor on"). "Switchmotor on" .1.4.2 ( S7-). . (" "). , . , ., I/O "", DP- . "Hardware Configuration" , S7-, . (. 2.3 " ").1.4.3 , , , ( I/O-). / 0 , , CPU. , / (S7-). . (" "). () 8 (.. ). 0, 1, 2 3; . , 8 8,9, 10 11 .Automating with STEP 7 in STL and SCL1- 27 STEP 7 STL SCL 56. 1. SIMATIC S7-300/400 ( ), "" ("channel"), 2 . , 2, 4, 8 16 , 4, 8, 16 32 . ( ) CPU , , . ( ) 0. . S7-3xx DP-, S7-318 S7-400 . . . , () I/O- . I/O . DP- , ( ) . DP- I/O , SFC 14 DPRD_DAT SFC 15 DPWR_DAT. , "Input" ("") "Output" (""). , FM CP .1.4.4 , . ( ), . , , , , , , . I/O . 0; ( ), CPU . STEP 7 , I/O. 1- 28 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 57. 1. SIMATIC S7-300/400 . ; (. 20.4.1" ").1.4.5 , DP- (, DP- ) PROFIBUS , .MPI-, MPI- (, CPU, FM CP), MPI-. PG, HMI- . , S7-300 FM CP, , MPI-, MPI-CPU. CPU 318 MPI- , MPI-. .1.5 : ; ; ; (. 7 " " 8" "); L- ( 18.1.5 " "). ( ) , .1.5.1 SIMATIC S7 : , LOAD TRANSFER .Automating with STEP 7 in STL and SCL1- 29 STEP 7 STL SCL 58. 1. SIMATIC S7-300/400 , , I/O. () . . / . , , (). . , 1, 2, 4 . 0. 0 ; . I/O , PI- ("peripheral inputs") ( ) PQ- ("peripheral outputs") ( ). , CPU . . PI- . 0- I/O, CPU. (Direct I/O Read) , (, ). , , . . , , . , . . PQ- . 0- I/O, CPU. (Direct I/O Write) , (, ). 1- 30Automating with STEP 7 in STL and SCL STEP 7 STL SCL 59. 1. SIMATIC S7-300/400 , , . . , (!), , .1.5.2 ( ) ( ) , , . (I), (Q). , . , , . 20.2.1 " ". S7-300 CPU , 1998 ., S7-400 CPU , , , . , . CPU, , CPU 417, . , , , (work) . CPU (work) , . - . - , . CPU . : (I/O ). , (, - I/O , , , ). , . ( ). .Automating with STEP 7 in STL and SCL1- 31 STEP 7 STL SCL 60. 1. SIMATIC S7-300/400 , , , RAM-. , . , . . (. 20.2.4 " "). - . - , . CPU . : ( I/O ). , (, - I/O , , , ). , . . . , , , RAM-, , . . . 20.2.4 " " , .1.5.3 " " . . . CPU, , , . CPU. , , . : , , . , , . 1- 32Automating with STEP 7 in STL and SCL STEP 7 STL SCL 61. 1. SIMATIC S7-300/400 , , . 0- . CPU. 22.2.3 "". . ( ), (watchdog) ( ) . - , /, 1:1. , , (. .1.7). CPU. , . 7654 3 2 1 010 5 ( [flickering light])2,5 ( [fast flashing light]) 2 1,25 ( [flashing light]) 1 0,625 ( [slow flashing light]) 0,5 .1.7 Automating with STEP 7 in STL and SCL1- 33 STEP 7 STL SCL 62. 1. SIMATIC S7-300/4001- 34Automating with STEP 7 in STL and SCL STEP 7 STL SCL 63. 2 STEP 72.1 STEP 7 (STEP 7 Basic Package) STEP 7 (STEP 7 Basic Package) 5.1. , , . STEP 7 (STEP 7 Basic Package) : STL ("statement list" - ), LAD ("ladderdiagram" - ), FBD ("function block diagram" - ). S7-SCL ("Structured Control Language" ), S7-GRAPH ( SIMATIC ), S7-HiGraph ( SIMATIC ).2.1.1 STEP 7 V 5 32- , : Microsoft Windows 95( Service Pack 1, 4.00.950), Windows 98 Windows NT ( Service Pack 2, 4.00.1381). STEP 7 Windows 95/98 (PG) () 80486 32 ( : Pentium 64 ). Windows NT Pentium 32 ; STEP 7 Windows NT. STEP 7, ,, , 100 , PG . STEP 7 V 5 200 380 (, ) . (128 256 ).Automating with STEP 7 in STL and SCL2- 1 STEP 7 STL SCL 64. 2. STEP 7 , . , , . . Windows. STEP 7 SETUP Windows 9x/NT, -. PG STEP 7 . STEP 7 - (.), NCM STEP 7 AcrobatReader V3.01. MPI-. PG MPI-, MPI-. , . STEP 7 V 5 , , , , . Windows SIMATIC Workstation. .2.1.2 STEP 7 ( ). . STEP 7 , . , . , - . , , - , ( ) " " (emergency license), - ( ).2.1.3 SIMATIC ManagerSIMATIC Manager STEP 7. Windows:SIMATIC Manager . 2- 2 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 65. 2. STEP 7 " " (ProjectWizard). . , Check box "Display Wizard on starting theSIMATIC Manager" (" - SIMATICManager"). - : File () -> "New Project" Wizard. ("project"). . ZEn01_09_S7_ZEBRA : File () -> Open (), : (), - (.2.1)..2.1 SIMATIC Manager "+" ; . SIMATIC Manager STEP 7."" , SIMATIC Manager, "" (). () , (station) (PLC).Automating with STEP 7 in STL and SCL 2- 3 STEP 7 STL SCL 66. 2. STEP 7Project MPISubnet [PTP, PROFIBUS, Ethernet]()SIMATIC 300/400 station Hardware Configuration table ( ) ( ) CPU xxx CPUConnectionsConnection table () ( ) S7 program SymbolsSymbol table (()( )) GDSources Source files Source programs ( ) ( ) (STL-, SCL-)Blocks OB n FB n FC n DB n SFC n SFB n . , CPUSystem data ( )UDT nData types (- , ) VAT nVariable table ( ) S7 program , CPU ( , S 7-, CPU).2.2 STEP 7 , ,, MPI. CPU, CPU S7-. , Blocks (), . 2- 4 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 67. 2. STEP 7 STEP 7 . . 2.2 ("mainbranch" - " "), S7 (offline view). , , . (offlineview) . PG. PG (online) CPU ( PLC), (online view), : View -> Online ( -> ). , ; , , . , (online) (offline) . . :Options -> Customize ( -> ) "View" (""). : Options -> Customize ( -> ), SIMATIC Manager, session language (), , . : - , . - (. ) , , , , : Edit ->Object Properties ( -> ), . , CPU, (), (Hardware Configuration). - , , , SIMATIC Manager , , SIMATIC Manager (, ). . , . . .Automating with STEP 7 in STL and SCL 2- 5 STEP 7 STL SCL 68. 2. STEP 72.1.4 (Project(s) Library(ies)) STEP 7 " ", , (project) (library). (projects) . : ; ; ; ( , , ). . . . (library) . . STEP 7 , ( ), . (online) ( ), . STEP 7 V5 Standard Library, : System Function Blocks ( ), , CPU; S5-S7 Converting Blocks ( S5-S7 ), S5-S7 ( S5 ); T1-S7 Converting Blocks ( TI-S7 ), TI- S7 ; IEC Function Blocks ( IEC), DATE_AND_TIME STRING; CommunicationBlocks( ), CP; PID Control Blocks ( -), ; Organization Blocks ( ), ( ). 33 " ". 2- 6Automating with STEP 7 in STL and SCL STEP 7 STL SCL 69. 2. STEP 7 S7- , . . : File -> Open ( -> ), . . : File -> New ( -> ) ( ). ( ) : Options -> Customize ( -> ) New (). Insert () (, ). , , SIMATICManager. : Edit -> Copy ( -> ) Edit -> Paste ( -> ) , Windows, "drag-n-drop", . , , SIMATIC Manager.2.1.5 (Online Help ) (Online Help) SIMATIC Manager , . , Help(). Getting Started (), , SIMATICManager. : Help -> Contents ( -> ) STEP 7 . . : Help -> Context-Sensitive Help F1 ( -> ) , F1, , "" , , . , . (, ), .Automating with STEP 7 in STL and SCL 2- 7 STEP 7 STL SCL 70. 2. STEP 72.2 "" ("") , . , , ( , CPU) . , S7- - . , ( , CPU, ) Hardware Configuration tool. , SIMATIC Manager. , , (!) Windows Explorer () SIMATIC Manager.2.2.1 Project Wizard ( ) STEP 7 V3.2 STEP 7 Wizard . CPU, - S7- CPU, S7-, . S7- "", , . 2.1.3 "SIMATIC Manager" . : File -> New ( -> ), , , , "" "Enter". : Insert -> Station -> Simatic 300 Station ( -> -> S7-300) ( S7-300). 2- 8 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 71. 2. STEP 7 , project ; SIMATIC Manager Hardware () . Hardware Hardware Configuration, . , : View -> Catalog ( -> ). (rail), , "SIMATIC 300" "RACK 300" "drag-n-drop" (station window). , . , "drag-n-drop", . CPU, , CPU 314 2. . 2.3 " ". , SIMATIC Manager. CPU. CPU SIMATIC Manager S7- . . S7- CPU; S7- (S7-program) (connection table). S7-program; SIMATIC Manager (Blocks - ), . (Blocks - ); SIMATIC Manager (Systemdata - ) (main) (OB1) . . 1 . : Insert -> S7 Block -> (Blocks ) . System data ( ) . .Automating with STEP 7 in STL and SCL 2- 9 STEP 7 STL SCL 72. 2. STEP 7 Hardware () Station (). System data ( ) CPU, : PLC -> Download(PLC -> ), CPU. Source Files ( ) . Source Files : Insert -> S7 Software ->STL Source File ( -> S7 -> STL- ) Source Files , ASCII ( STEP) , : Insert-> External Source File ( -> ). S7- , . . S7-, : Insert-> Program -> S7 Program ( -> -> S7- ). S7- SIMATIC Manager Symbols () Sources ( ) Blocks (). Blocks () OB 1. library (), , . , . , (online) , S7- .2.2.2 , SIMATIC Manager "" ("main objects"), , () . () STEP 7 . File -> Rearrange ( ->) SIMATIC Manager , , . , . : File-> Archive ( -> ). SIMATIC Manager ( ) . , . STEP 7 ARJ PKZIP2.50, (,winzip, 6.0, pkzip, 2.04g, JAR, 1.02 LHARC, 2.13). 2- 10 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 73. 2. STEP 7 , () . "" : File ->Retrieve ( -> ), . . "Archive" (""), : Options -> Customize ( -> ). "Generate archive name automatically" (" "), /, . CPU STEP 7 V 5.1, S7-400 CPU () CPU, . , , , , , . , , CPU. , CPU, , CPU PLC -> Save Project on Memory Card (PLC -> ). : PLC -> Retrieve Project fromMemory Card (PLC -> ). , , CPU, , . , CPU, , CPU PLC ->Display Accessible Nodes (PLC -> ). PG, : File -> S7 MemoryCard -> Open ( -> S7 -> ) .2.2.3 (Project Versions) SIMATIC. STEP 7 V1 1, STEP 7 V2 2, STEP 7 V3/ V4/ V5.0 - 2 3. STEP 7 V5.1 3 3.Automating with STEP 7 in STL and SCL2- 11 STEP 7 STL SCL 74. 2. STEP 7 1 2, : File -> Open Version 1 Project ( -> 1). , 1, STL-, . 2 STEP 7V2, V3, V4 V5.0 (. .2.3). STEP 7 V1 1 (V1) STEP 7 V5.1 : File -> OpenFile -> New ->Version 1 Project ( -> project 1) ( -> File -> Open ->V1 V2 ( -> )) V2 V3 V3 3 (V3) 3 (V3) File -> New -> 2 (V2) project 2. ( -> ) V2 2 (V2) File -> Save as( -> ) V2 V3 V2 V3 STEP 7 V2 STEP 7 V3/ V4/ V5.0.2.3 STEP STEP 7 V5.1 3. , V1 V2, : File -> Open Version 1 Project ( -> 1). 2, : File ->Open ( -> ). , V2.2- 12 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 75. 2. STEP 72.3 Hardware Configuration. (offline), .. CPU. . . : Edit -> Open Object ( -> ) (Hardware object) SIMATIC 300/400 Station. (basic settings) , : Options -> Customize ( -> ). : Station ->Consistency Check ( -> ). : Station -> Save ( -> ) . : Station -> Save and Compile ( -> ) , System data ( ) "" (offline) Blocks (). CPU, :PLC -> Download (PLC -> ). System data () "" (online) Blocks () CPU. "" , : PLC -> Upload (PLC -> ). , : Station -> Export ( -> ). STEP 7 ASCII , . , , () . ASCII . (Checksum) Hardware Configuration . , "" (offline) "" (online) . (Checksum) System data ( ).Automating with STEP 7 in STL and SCL 2- 13 STEP 7 STL SCL 76. 2. STEP 7 Blocks () S7- , System data ( ) : Edit -> Open Object ( -> ). . Blocks (): Blocks (), : Edit -> Object Properties ( -> ) "Checksums" ( ). (Station) Hardware Configuration (. . 2.4). . 2.4 , Hardware Configuration () . DP- . , , PROFIBUS, DP- . , DP- , . 2- 14Automating with STEP 7 in STL and SCL STEP 7 STL SCL 77. 2. STEP 7 (Hardware) :View -> Catalog ( -> ). , , , STEP 7. : Options -> Edit Catalog Profile ( -> ) , , . "" . (Configuration table) Hardware Configuration , , DP-. , , . (properties), .2.3.1 "" "drag-n-drop" , , "SIMATIC 300" "RACK 300" . . . , "No Parking" ("") , . S7-300 3 : . . S7-400 ( : ) "Link" () ("Properties") ("Send") IM. , : Edit -> Object Properties ( -> ). I/O 20.4.2 " I/O".2.3.2 Hardware Configuration .Automating with STEP 7 in STL and SCL2- 15 STEP 7 STL SCL 78. 2. STEP 7 . S7-400 CPU S7-300 CPU DP- . S7-400 S7-300, . , , () . , ; . S7-400, . , , CPU. : View -> Address Overview ( -> ) CPU. MPI MPI-. . , , MPI- , CPU. , Hardware Configuration () , (Symbol Table). . ( ) : Edit -> Symbols ( -> ) , , ( ). "Add Symbol" (" ") . "Apply" ("") (Symbol Table). "OK" .2.3.3 . , , . , . , 2- 16Automating with STEP 7 in STL and SCL STEP 7 STL SCL 79. 2. STEP 7 : Edit -> Object Properties ( -> ). . CPU . SFC 55 WR_PARM, SFC 56 WR_DPARM SFC 57PARM_MOD.2.3.4 MPI MPI- (ModuleProperties). CPU MPI, , , : Edit -> Object Properties ( -> ). "General"("") "Properties" () "Interface"(). , "Parameter" (), . MPI-, CPU. , S7-300 CPU, FM CP MPI- MPI- , CPU. MPI- MPI-, ( FM CP!). .: CPU , CPU (). "CPUxxx(1)", MPI-. CPU, , .. "CPUxxx(1)" "CPUxxx(n)", "n" MPI-. MPI- MPI- PG () . PG () MPI-; (spur-line) - MPI- .: 0 , 1 - 3 - CPU ( , ).Automating with STEP 7 in STL and SCL2- 17 STEP 7 STL SCL 80. 2. STEP 72.3.5 Monitor () Modify () Hardware Configuration . , (online) , CPU. . , : PLC -> Monitor/Modify (PLC -> /) . "Status Value" ( ) Hardware Configuration . "Modify Value" ( ) , "Modify Value". checkbox "I/O Display" ( I/O), / / ( ). checkbox "Enable Periph Outputs" ( ), , CPU STOP (. 2.7.5 " "). 2.7.3 " " 2.7.4 " ".2.4 (Network) SIMATIC S7-. . SIMATIC Manager. ( CPU CP), Hardware Configuration; . - (connection) Network Configuration (connection table). Network Configuration . Network Configuration ; ("node properties") . 2- 18 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 81. 2. STEP 7 (connections) Network Configuration : MPI-, . , : Insert -> Subnet ( -> ). Network Configuration , , . station () . . , . (communication connections) (connection table), . Network Configuration: MPI : Options -> Define Global Data ( -> ) (. 20.5 " "). : Network -> Save ( -> ) . : Network ->Consistency Check ( -> ). : Network -> Save and Compile ( -> ). Network () Network Configuration . SIMATIC Manager MPI-. Network Configuration. , Connections () CPU. . 2.5 NetworkConfiguration, () (connections). (connection table) . , , , , S7-400 CPU. SIMATIC, DP-. : View -> Catalog ( -> ). "" .Automating with STEP 7 in STL and SCL 2- 19 STEP 7 STL SCL 82. 2. STEP 7 . 2.5 Network Configuration : View -> Zoom In ( -> ), View -> Zoom Out ( -> ) View -> Zoom Factor ( -> ) .2.4.1 (NetworkView) "" . . . 2- 20Automating with STEP 7 in STL and SCL STEP 7 STL SCL 83. 2. STEP 7 , . "". Hardware configuration, , , () . (Network Configuration). , , , . , "" . . . . . , . : Edit -> Object Properties ( -> ) . "General" () S7- (ID). ID - . ID S7- (online) , . (network properties) "NetworkSettings" (" "), , (datatransfer rate) (highest node address). (network connection), : Edit -> Object Properties( -> ), , (node address) (subnet), , . "Interfaces" ("") . ( Hardware Configuration).2.4.2 DP- NetworkConfiguration NetworkConfiguration I/O. Automating with STEP 7 in STL and SCL 2- 21 STEP 7 STL SCL 84. 2. STEP 7 : View -> with DP Slaves ( -> DP-), (slave) DP- (Network View). DP- : PROFIBUS ( , "" PROFIBUS ). DP- (master) ( , "" , DP- Hardware Configuration CPU , ). (connection) DP- PROFIBUS ( Hardware Configuration, DP- (master) Network Configuration "" PROFIBUS). DP- (master), DP- (slave). DP- (slave) "PROFIBUS" , "" . DP- (slave) : Edit -> Open Object ( -> ). Hardware Configuration. , (slave), I/O (. 2.3 " "). DP- , (. 20.4.2 " I/O"). DP- (slave) "Already created stations" (" "). DP- (master) "" ( Hardware Configuration). : View -> Highlight -> Master System ( -> -> DP-) DP- (DP-master system). () (master) (slave) .2.4.3 (Connections) (Connection) . 2- 22 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 85. 2. STEP 7 SFB- SIMATIC S7- ("Communications via configured connections" - " ") SIMATIC S7-. : (online) MPI- . , , . (Network Object Catalog) PG/PC Stations (), PG/PC (network), .Connection table ( ) (Connection table). : , , . Connections () CPU (Connection table). Connections () Network Configuration, . S7-400 CPU Network Configuration. (Connection table) (. : 2.1). , , , . 2.1 (Connection table)Send OperatingActive Connection State MessageLocal ID Partner ID PartnerType Buildup((- (ID -() ()( ID) ))) 1 1Station 416/CPU416(5) S7 connectionYes () No () 2 2Station 416/CPU416(5) S7 connectionYes () No () 3Station 315/CPU315(7) S7 connectionYes () No () 4 1Station 417/CPU414(4) S7 connectionYes () No () : Insert -> New Connections ( -> ) . (connection) ("active") CPU. , S7-300 CPU ; S7-300 CPU "" ("passive") S7-.Automating with STEP 7 in STL and SCL 2- 23 STEP 7 STL SCL 86. 2. STEP 7 "New Connection" (" ") "Station" ("") "Module" ("") (. . 2.6); . . . 2.6 , check box "Show Properties Dialog" (" "). . : View -> Display Columns ( -> ), .Connection ID ( ) CPU. STEP 7 ID . .Local ID ( ID) ID ( local ID - ID ). , ID . 2- 24Automating with STEP 7 in STL and SCL STEP 7 STL SCL 87. 2. STEP 7 ID (local ID) . , , : S7-: 0001 16 0FFF16 PtP-: 1000 16 140016Partner ID (ID ) ID ( partner ID), CPU ID (local ID); : Edit -> Object Properties ( -> ). STEP 7 ID (partner ID), , () (. ).Partner () . , "Station" ("") "unspecified" (" "). (one-way connection) ; : SFB- S7-400 S7-300 CPU. SFB- S7-300, S7-400 CPU SFB 14 GET SFB 15 PUT. S7- 300, . (one-way connection) (connection table) "" ("active") CPU. STEP 7 ID ("Local ID"). . (two-way connection) ; , , S7-400 CPU. , , SFB 8 BSEND SFB 9 BRCV. (two-way connection) . STEP 7 ID ("Local ID"), ID ("Partner ID") . .Type () . STEP 7 (connection type):Automating with STEP 7 in STL and SCL 2- 25 STEP 7 STL SCL 88. 2. STEP 7 PtP connection ("Point-to-point", " ") PTP ( 3964 (R) RK 512) SFB-. PtP . SIMATIC S7 CP SIMATIC S7 ( SIMATIC),, -. S7 connection MPI, PROFIBUS Industrial Ethernet SFB-. S7 SIMATIC S7, PG HMI ( -). S7 . Fault-tolerant S7 connection ( S7) PROFIBUS Industrial Ethernet SFB-. S7 SIMATIC S7 . "NCM S7 for PROFIBUS" "NCM S7 for Industrial Ethernet" . NCM : FMS-, FDL-,ISO transport-, TCP-, ISO-on-TCP-, UDP- E-mail-. (Active Connection Buildup) , , (). , . check box "Active connectionbuildup" (" ") : , : Edit -> Object Properties( -> ). (Sending operating state messages) . , check box . CPU SFB 23 USTATUS. (Connection Path) , , () (Connection Path). , STEP 7 : Industrial Ethernet, Industrial Ethernet/TCP-IP, MPI , , PROFIBUS. 2- 26 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 89. 2. STEP 7 CPU, , . "Interface" ("") . CPU (, S7-400 CPU ), "PLC-internal" (" PLC"). "Type" ("") , . ,, MPI- PROFIBUS-, "MPI". "PROFIBUS", STEP 7 . MPI PROFIBUS "Address"(""). (Connections between projects) S7 , SIMATIC-, "unspecified" ("") ( )., , STEP 7 . . S7- (Connection to non-S7 station) , S7-, : ( [ Siemens] , S7- ) PG / () SIMATIC S5- , ( S7) , (, Network Configuration, :Edit -> Object Properties [ -> ] "Interfaces" [""]).2.4.4 (Network Transitions) , . S7-, MPI-. - S7- , PROFIBUS, . , .Automating with STEP 7 in STL and SCL 2- 27 STEP 7 STL SCL 90. 2. STEP 7 , (routing table), . S7- "", . , , , ( ). "placeholder" (""), PG/ (Network Object Catalog) . PG/ , PG. PG : PLC -> Assign PG/PC (PLC -> PG/). . PG : PLC -> Undo PG/PC Assignment (PLC -> PG/). (online) , , ID S7- . ID S7- : . ID . , - : Edit -> Object Properties ( -> ) "General" ("").2.4.5 (Loading the Connection Data) , ("connection table") PLC ( "" CPU). : (network window), . , . . , , STOP. : PLC -> Download -> (PLC -> -> ) . , , : -> Selected Stations ( ) -> Selected and Partner Stations ( ) -> Selected Connections ( ) -> Stations on Subnet ( ) -> Connections and Gateways ( ) 2- 28 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 91. 2. STEP 7 (connection table). (System data) Blocks. CPU . (online) MPI . PG Ethernet PROFIBUS, . "Set PG/PC Interface" Windows.2.5 S7-2.5.1 ( ) S7 Program. CPU , CPU. S7 Program Symbols () Source Files () Blocks () (. . 2.7).. 2.7 , .Automating with STEP 7 in STL and SCL2- 29 STEP 7 STL SCL 92. 2. STEP 7 ("source-oriented") Source Files ( ). - ASCII, , . ; Blocks (). MC7 S7 CPU. "" ("incremental"), - - . . , Blocks (). (online) CPU, . . - , , I1.0 ( ). Symbol Table Symbols, , , "Switch motor on" (" ") , ( ). Blocks () , (Symbol Table) - , (address priority). SIMATIC Manager , : Edit -> Object Properties ( -> ), "General-Part 2" (" - 2"). , SIMATIC Manager Blocks () : Edit -> Object Properties ( -> ). Blocks () (load memory) (work memory), . ; .2.5.2 (Symbol Table) , .. , , . (, I1.0) (, Start signal []). . , , . 2- 30 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 93. 2. STEP 7 (local) (global) ( ). (local) , . . . ( Symbols S7 Program). 24 . , , , . 00 hex, FF hex ("). . . 80 . : I, Q, PI PQ M, T C OB, FB, FC, SFC, SFB DB , , UDT VAT ; (declaration section) (declaration section) . S7- SIMATIC Manager Symbols. (. 2.8).. 2.8 Symbol TableAutomating with STEP 7 in STL and SCL2- 31 STEP 7 STL SCL 94. 2. STEP 7 S7- Symbols. . , ., BOOL , INT , 16- . 3.7 " " 24 " ", STEP 7. "" ; . , ., . "" , . , . : ASCII ( *.asc),sequential assignment list ( - *.seq), System Data Format ( - *.sdf Microsoft Access) Data Interchange Format ( - *.dif Microsoft Excel). . . : Edit -> Special Object Properties ( -> ), . : HMI WinCC S7-PDIAG : View -> Columns O, M, C, R ( -> O, M, C, R), . : Options ->Customize ( -> ) , , .2.5.3 STL- (STL Program Editor) STEP 7 (STEP 7Basic Package) LAD, FBD STL. STL- "" () 2- 32 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 95. 2. STEP 7 . . 2.9 , STL-.Symbols (Symbol table)Sources , (Source programs) Blocks ( ) (off-line) off-line PG ( ) PLC PLC (PLC(PLC download) upload) on-line ( ) CPU Blocks ( )(on-line). 2.9 STL Editor. , . , . , , .Automating with STEP 7 in STL and SCL2- 33 STEP 7 STL SCL 96. 2. STEP 7STL- "" ("decompiled"), .. MC7 (offline database) ( CPU, PG ). , STL- . STL- SIMATIC Manager, , OB1 Windows: Start -> Simatic -> STEP 7 -> LAD, STL, FBD -Program S7 Blocks. :Options -> Customize ( -> ). "Editor"("") , , , , , . Blocks () (, ) . , , Source files ( ). , , , .. , . , , LAD FBD. MC7 . , , . , - . , , " " . , , , (block protection KNOW_HOW_PROTECT). , , CPU. , . , ACSII-. , (online), ( ) . 2- 34 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 97. 2. STEP 7, "Source-oriented" ( ) STL- Source Files ( ). STL- ACSII- . , . SIMATIC Manager Source Files ( ) : Insert -> S7 Software-> STL Source File ( -> S7 -> STL-). , : Insert -> Block Template -> ( -> -> ) ( ). - Step7S7ska, S7kafnnx.txt. , . STL- : File -> Generate Source File ( -> ). , SIMATIC Manager: Insert -> External Source File ( -> ) Source Files ( ). :Edit -> Export Source File ( -> ). , , , . 3.4.3 " , STL" 3.6.2 " , " STL-. STL- , . Blocks (). STL-, . "Source Files" (" ") , : Options -> Customize ( -> ) , , , , , . "Generate Block" (" ") . : File -> Consistency Check ( -> ) Automating with STEP 7 in STL and SCL2- 35 STEP 7 STL SCL 98. 2. STEP 7 . , : File -> Compile ( -> ). . , . , , , , CPU, , . , ( 3.4.3 " , STL"). STL- "Source Files" (" ") , : Options -> Customize ( -> ) "Generate source files automatically" (" "), ( ). . . "Execute" ("") , . (offline), (online) Blocks (). . , , , . "Create Block" (" "), : Options -> Customize ( -> ), (reference data) . (offline) (online) CPU (, , ["programmable controller"] PLC). SIMATIC Manager ("offline" "online"); . "" ("offline") PG. ("offline") : File -> Save ( -> ) CPU : PLC -> Download (PLC -> ). 2- 36 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 99. 2. STEP 7 , CPU, : File -> Save as ( -> ). CPU "" ("online"). CPU . CPU: PLC -> Download (PLC -> ). CPU (RUN) , . , "" ("online") ("offline") , : File -> Save ( -> ). 2.6.4 " CPU" 2.6.5" " (online) . 3.4.2 " STL" 3.6.1 " STL" , STL-.2.5.4 SCL- (SCL Program Editor) S7-SCL SCL. S7-SCL SIMATIC Manager. . SCL, , (. . 2.10). , . , Blocks (), . , , STL. , . SCL- , , . (: CPU, ). STL- SCL- SIMATIC Manager SCL- SCL- Windows: Start -> Simatic -> STEP 7 -> S7-SCL -> ProgramS7 Blocks. SCL- , , , STL-.Automating with STEP 7 in STL and SCL2- 37 STEP 7 STL SCL 100. 2. STEP 7Symbols (Symbol table)Sources , (Source programs) Blocks ( ) (off-line) PG (PLC PLCdownload) Blocks ( ) (on-line) CPU . 2.10 SL Program Editor. SL- : Options -> Customize ( -> ). "Editor" ("") , , , , . SCL- Source files ( ) SIMATIC Manager : Insert -> S7 Software -> SCL Source File ( -> S7 -> SCL-), . . : Insert -> Block Template -> ( -> -> ), 2- 38 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 101. 2. STEP 7 . SCL- , SIMATIC Manager: Insert -> External Source File ( -> ) Source Files ( ). :Edit -> Export Source File ( -> ). , "Window" (""). , , , . 3.5.2 " SCL" 3.6.2 " , " SL-. SCL- , . Blocks (). SCL-, . "Compiler"("") , :Options -> Customize ( -> ). Create object code ( ): , , , ; . Optimize object code ( ): , . Monitor array limits ( ): , , , , . Create debug info ( ): Program Status, . ( - ) Set OK flag ( OK): , OK EN/ENO.Automating with STEP 7 in STL and SCL 2- 39 STEP 7 STL SCL 102. 2. STEP 7 , : File -> Compile ( -> ). . , . , , , , CPU, , . , : File -> Partial Compile ( -> ). , ( 3.5.2 " SCL"). SCL- DB, . DB (Symbol Table) . , , , IEC-, Blocks () . : PLC -> Download (PLC -> ) CPU , Blocks () . SCL , , . : Insert -> SCL Compilation Control File ( -> ) Source Files ( ). , . : File -> Compile ( -> ) .2.5.5 (Rewiring) Rewiring . , I 0.0 I 0.7 I 16.0 I 16.7. , , , , FC FB. SIMATIC Manager , ; , , Ctrl, - Blocks (). 2- 40Automating with STEP 7 in STL and SCL STEP 7 STL SCL 103. 2. STEP 7 , , : Options -> Rewire ( ->). , O, , SIMATIC Manager . , . : Address priority ( ). , , , (rewire).2.5.6 (Address Priority) ("offline") Blocks () "Blocks" ("") ( ) , . . : "Absolute address has priority" ( ) ( , STEP 7). , , , . : "Symbol has priority" ( ), , , .: :I 1.0 "Limit_switch_up" (" ")I 1.1 "Limit_switch_down" (" "), I 1.0:A I 1.0 "Limit_switch_up" : "Symbol has priority" ( ), :I 1.0 "Limit_switch_down" (" ")I 1.1 "Limit_switch_up" (" "), :A I 1.1 "Limit_switch_up" (" "), : "Absolute address has priority" ( ), :A I 1.0 "Limit_switch_down" (" ")Automating with STEP 7 in STL and SCL 2- 41 STEP 7 STL SCL 104. 2. STEP 7 , "Absolute address has priority" ( ), ( ), . : "Symbol has priority" ( ), ( ). : "Symbol has priority" ( ), . (rewired) . : (rewiring) , MC7- . , .2.5.7 (Reference Data) SIMATIC Manager (Reference Data), . : Cross references ( ) Reserved locations ( : I, Q, M, T, C) Program structure ( ) Unused symbols ( ) Addresses without symbols ( ) Blocks () : Options -> Reference Data -> Display ( -> -> ). : View -> Filter ( -> ); : Save as Standard ( ). . C : Options -> Customize ( -> ) "Create Blocks" (" ") . : (offline) ; "" (offline) , , (online). 2- 42 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 105. 2. STEP 7 (Cross references) . , ( ), , ( ) . STL- , , , ; SCL- - . . , : Edit -> Go To -> Line( -> -> ) , . (: View -> Filter ( -> ) (, ). , , . STEP 7 ("Standard") . : , . , (, ). (Assignments) I/Q/M , I, Q M . . (, ). T/C , . . : , () . (Program structure) . ("starting blocks") . :"" (tree structure) . , - "+" "-". , ("temporary local data"), ("path"). , . "-" (Parent-child structure) 2 , , .Automating with STEP 7 in STL and SCL2- 43 STEP 7 STL SCL 106. 2. STEP 7 : , , , , ( ). (Unused symbols) , , . , , . : , , , , . (Addresses without symbols) , . , . : , , ( ).2.5.8 SIMATIC Manager . , . , , , , , STEP 7 SIMATIC Manager : Options -> Customize ( -> ) "Language" (""). , .. , STEP 7. . , , (, ), . , . , *.csy , Microsoft Excel. (translation) (translation table) . () . . (Exporting and importing texts) SIMATIC Manager , , (), , , (block container), . : Options -> Manage Multilingual Text -> Export ( -> -> ). 2- 44Automating with STEP 7 in STL and SCL STEP 7 STL SCL 107. 2. STEP 7 (storage location) , (target language). (Text type), ( 2.2). 2.2 (Text type) ()Text type ( ) Meaning ()BlockTitleBlock title ( )BlockCommentBlock comment ( )NetworkTitleNetwork Title( )NetworkCommentNetwork Comment( )LineComment Line Comment ( )Comment in( declaration table of - code blocks InterfaceComment data blocks- user data type UDT - )SymbolComment Symbol Comment ( ) , , SymbolComment.csv. . () () Microsoft Excel : File -> Open ( -> ) ( ). , () . : Options -> Manage Multilingual Text -> Import ( -> -> ). (log-) , .: , (Text type), . SIMATIC Manager : Options ->Manage Multilingual Text -> Change Language ( -> -> ). (, ), . ( log-).Automating with STEP 7 in STL and SCL 2- 45 STEP 7 STL SCL 108. 2. STEP 7 SIMATIC Manager : Options -> ManageMultilingual Text -> Delete Language ( -> -> ).2.6 (Online Mode) , engineeringsystem (ES). S7- (offline) , . CPU PG CPU, - ("online") . CPU (assigned) , .. .2.6.1 PLC (Connection a PLC) MPI- PG MPI- CPU (online) . , CPU . CPU MPI-, CPU (MPI-). MPI- CPU. CPU CPU System Data ( ) Blocks () Hardware Configuration : PLC -> Download (PLC -> ). CPU MPI- ("naming" - ) .MPI- CPU MPI- , MPI- CPU. : MPI- . , , , , MPI-.MPI- CPU . ,CPU . (online) CPU, , , PG . 2- 46 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 109. 2. STEP 7 PG , CPU : PLC -> DisplayAccessible Nodes (PLC -> ). (project) :"Accessible Nodes" - "Module (MPI=n)" - "Online User Program (Blocks)"[" " - " (MPI=n)" - " ()"]. Module (online), (operational status) (module status). Blocks(), , CPU. (, ,) . CPU ,, PG (datamanagement system). SIMATIC Manager, , - : PLC -> Upload Station (PLC -> ). CPU (online) . CPU, (online) . MPI- CPU , (online) S7- : Edit -> Object Properties ( -> ), CPU "Addresses Module". S7- (online), (online) CPU. Blocks () , CPU. (offline) (online) , , PG ( ,). , CPU, (online) , , CPU . , SIMATIC-, .. CPU, .2.6.2 CPU . , , . , , () . "Protection" ("") Hardware Configuration CPU.Automating with STEP 7 in STL and SCL 2- 47 STEP 7 STL SCL 110. 2. STEP 7 1: (Protection level 1: keylock switch position) ( ). CPU. RUN-P STOP ; RUN " " PG. , . RUN, , "Can be revoked with password" (" "), , CPU . 2: (Protection level 2: write protection) . 3: (Protection level 3: read/write protection) . (Password protection) 2 3 1 "Can be revoked with password" (" "), . 8 . , , . CPU, : PLC -> Access Rights (PLC -> ). CPU S7-. "Enter Password" (" ") "Use password for other protected modules" (" ") . ("Password access autorization") , S7 . , , CPU . 2- 48Automating with STEP 7 in STL and SCL STEP 7 STL SCL 111. 2. STEP 72.6.3 CPU (CPU Information) (online) , CPU. , - ( [online] ) S7- ( [online] ). PLC -> Diagnose Hardware (PLC -> )(. 2.7.1 " " ) PLC -> Module Information (PLC -> ) (, , ), , ( [map] [work memory] [load memory], [compression]), [cycle time] ( , ), ( CPU, , ), ( , , , SFC SFB), ( ), STOP (B-, I- L-) "Addresses Module". PLC -> Operating Mode (PLC -> ) (, RUN STOP), . PLC -> Clear/Reset (PLC -> /) CPU STOP-. PLC -> Set Date and Time (PLC -> ) CPU. PLC -> CPU Messages (PLC -> CPU) , , SFC 52WR_USMSG, SFC 18 ALARM_S SFC 17 ALARM_SQ. PLC -> Display Force Values, (PLC -> ), PLC -> Monitor/Modify Variables, (PLC -> / )(. 2.7.3 "/ " 2.7.4" ").2.6.4 CPU CPU ( , ) (load) CPU. (load) RAM EPROM, CPU .Automating with STEP 7 in STL and SCL2- 49 STEP 7 STL SCL 112. 2. STEP 7 EPROM, : PG, CPU, . (work) CPU. CPU EPROM-, . (load) RAM, CPU : CPU STOP, . . RAM- (backup battery). ( CPU, , GD-, ..), CPU System data ( ). : PLC -> Download (PLC -> ). CPU ; (startup). , PLC System data ( ). : PLC -> Download (PLC -> ) , , GD-, PLC. : : PLC -> Save Project on Memory Card (PLC -> ) (. 2.2.2 ", "). , , PG, CPU.2.6.5 (Block Handling) (load) RAM, (online), , . CPU, "" (offline) : PLC -> Download (PLC -> ). "" (online) "" (offline) , "" ( "drag-n-drop"). . , CPU, , " ". , . " " . , , . 2- 50 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 113. 2. STEP 7 SIMATIC Manager "" (offline) "Blocks" ("") CPU SCL. CPU , SCL-. SCL- . (online) STL (online) ( CPU), , (offline) . , "" "" , , "" ; ( , , , ) ., , (offline) , (, " " ["time stamp conflict"], ). (load) RAM -, . EPROM, , RAM- . EPROM "invalid" (""). , (load) EPROM (work) . EPROM PG. (compressing) CPU, CPU (load) (work) . (work) , " " (invalid)( ), "" ( ). , (invalid), . (gap) . Compress. RUN , , ; STOP .Automating with STEP 7 in STL and SCL2- 51 STEP 7 STL SCL 114. 2. STEP 7 : PLC -> Module Information (PLC -> ) "Memory" (""). . SFC 25 COMPRESS , . (online) (offline) (initial value) (actual value) (. 3.6 " "). CPU, (initial) (load) , (actual) (work) . . CPU, (work) , (actual) . (actual) : View -> Data View ( -> ). (actual) , CPU, (work) . (load) EPROM, (work) CPU. . . S7-300 , (retentive) , "UNLINKED" (""), (work) ; (load) . "UNLINKED" ("") SFC 20 BLKMOV.2.7 CPU () , . , , , , , . CPU STOP, , , CPU. . , , , CPU OB1. OB1 , , , , ,2- 52 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 115. 2. STEP 7 . ( ) PLCSIM, CPU PG .2.7.1 "Diagnose Hardware". PG MPI- SIMATIC Manager. , , PG, (online) : View -> Online ( - ). : PLC -> Display Accessible Nodes (PLC - ) CPU. : PLC -> Diagnose Hardware (PLC - ) (). Hardware Configuration ; SIMATICManager "View" ("") : Options ->Customize ( -> ). (status) (operating state) , , (project view - , ), (station view - , ) (module view - ).2.7.2 STOP CPU STOP - , , , - . CPU , , STOP , . PG (online) , S7- Diagnostics Buffer ( ) : PLC -> Module Information (PLC -> ). ( 1) CPU STOP, , "STOP becauseprogramming error OB not loaded" (" STOP - - ").Automating with STEP 7 in STL and SCL2- 53 STEP 7 STL SCL 116. 2. STEP 7 , CPU STOP, , : "FC not loaded" ("FC "). . , , "Open Block" (" "). , , CPU STOP , " " , , "Stacks" (""). "Stacks" (""), B- (block stack - ), , . "I stack", (interrupt stack), CPU (, , , ) , . "L stack" (local data stack - ), , B-. B- "" .2.7.3 (Monitoring andModifying Variables) - (Monitoring and Modifying of Variables), VAT- ( ). . , .. . : , ! , (Monitoring and Modifying of Variables), VAT- ( ), . 255 (VAT1 VAT255) (Symbol Table). VAT- 1024 255 (. . 2.11). VAT- (offline), Blocks (), : PLC -> Monitor/Modify Variables (PLC -> / ). ( ). 2- 54Automating with STEP 7 in STL and SCL STEP 7 STL SCL 117. 2. STEP 7 , : View -> Display Format ( -> ), "Display Format" (" ").. 2.11 (Variable Table) . , , . , . Blocks () :Table -> Save ( -> ). (online) VAT-, (offline), : PLC ->Connect To (PLC -> ). , - : PLC -> Disconnect (PLC ->) . (Trigger conditions) : Variable -> Trigger (-> ) (trigger point) (triggerconditions) . (trigger point) - , CPU .Automating with STEP 7 in STL and SCL 2- 55 STEP 7 STL SCL 118. 2. STEP 7 , . , . "Start of cycle" (" "), OB1. "End of cycle"(" "), OB1 . (Monitoring of Variables) : Variable ->Monitor ( -> ). VAT- . . , Display Format ( ). Esc. : Variable -> Update Monitor Values ( -> ) , . (Modifying of Variables) ( CPU ) : Variable -> Modify ( ->). VAT-, , . ("" ) "//" :Variable -> Modify Value Valid ( -> ); . , Display Format ( ). Esc. : Variable -> Activate Modify Values ( ->) , .2.7.4 (Forcing Variables) CPU - (Forcing Variables), , . 2- 56Automating with STEP 7 in STL and SCL STEP 7 STL SCL 119. 2. STEP 7 . CPU .: , ! VAT-. VAT-, - , . CPU. , , : Variable -> Display Force Values ( -> ). CPU, (force window) . . : Table ->Save As ( -> ). : I ( )[S7-300 S7-400] Q ( )[S7-300 S7-400] PI[ S7-400] PQ[S7-300 S7-400] [ S7-400] :Variable -> Force ( -> ).CPU . : (, load []) (, ) : . S7-400 (, transfer []) (, SFC) : . S7-300 .Automating with STEP 7 in STL and SCL 2- 57 STEP 7 STL SCL 120. 2. STEP 7 S7-300 : CPU ; CPU . : , CPU! , : Variable -> Delete Force ( -> ). , () , , CPU . , , , . I/O CPU. PI PQ (, ), PI PQ . , " " (access width) , (, [byte] [word]), . ( [access or area length error]), CPU " " ["error substitute value"] CPU STOP. , " " (access width) , (, [byte] [word]), . , (write protection) (synchronization error). (loading) . " " (access width) , , , . I , PI, ; . . PQ Q ( "" ["externally"] ). ; ( ). , 2- 58Automating with STEP 7 in STL and SCL STEP 7 STL SCL 121. 2. STEP 7 , , . "0" (substitute value) OD ( STOP [], HOLD [] RESTART []) - ( OD, ). OD , . STOP Enable PQ (PQ), STOP( OD-). Enable PQ( PQ) , ("safe") ( "0" [substitute value]); RUN.2.7.5 ( Enableperipheral outputs) STOP OD-. "Enable peripheral outputs" (" ") OD-, , , CPU STOP. . CPU . : STOP- .: . (PQ), . (online) : PLC ->Connect To (, CPU, , , : PLC -> Operating Mode, "STOP". OD- : Variable ->Enable Peripheral Outputs ( -> ); "0", (substitute value), (force value). : Variable -> Activate Modify Values ( -> ). . : Variable -> Enable Peripheral Outputs ( -> ) ESC.Automating with STEP 7 in STL and SCL2- 59 STEP 7 STL SCL 122. 2. STEP 7 OD-, "0", (substitute value), (force value) . STOP , "Enable peripheral outputs" (" "), , OD- (RESTART), RUN.2.7.6 "Program Status" (" ") STL "Program Status" (" ") . . "STL" : Options -> Customize ( -> ) ("Standard"[""] 1 ). (user memory) CPU, . , , "" (online) SIMATIC Manager. , . , . : Debug -> Monitor ( -> ) Program Status ( ). , . : Debug -> Monitor ( -> ) Program Status ( ). : Debug -> Call Environment ( -> " ") . , , , . (status recording), , . , "No Condition" (" "). , Program Status ( ). , , : Debug -> Modify Address ( -> ). Program Status ( ) . : "debug mode" ( ) "process mode" ( ). ( "debug mode" [ ]) . , , , . 2- 60 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 123. 2. STEP 7 "process mode" ( ) - , ,, ( ). CPU "Protection" (" ") CPU. CPU "debug mode" ( ), . , . : Debug ->Operation ( -> ). Breakpoints ( ),Single-step Mode ( ) , STL, CPU "Single-stepmode". CPU HOLD; . (breakpoints), (step-by-step). "debug mode" ( ). CPU "debug mode" ( ), . , . (breakpoint) : Debug -> Set Breakpoint ( -> ). : Debug ->Breakpoints Active ( -> ); CPU . CPU , CPU HOLD. . () , : Debug -> Execute Next Statement( -> ). , . , , : Debug -> Execute Call( -> ). : Debug -> Resume ( -> ) , ., , (online). . . : Debug -> Resume ( -> ) CPU RUN.Automating with STEP 7 in STL and SCL2- 61 STEP 7 STL SCL 124. 2. STEP 72.7.7 SCL- SCL-, "Create debug info" (" "). "Compiler" ("") : Options -> Customize ( -> ) SCL Editor. "Create object code" (" "), CPU : PLC -> Download (PLC -> ). SCL- SCL Editor. "Program Status" (" ") SCL ," " ("monitor area") . " " . . , , . , , () , , , - . SCL-, CPU RUN RUN-P . :Debug -> Operation -> Debug Operation ( -> -> ). , . : Debug -> Monitor ( -> ). . , : Debug ->Monitor ( -> ); : Debug -> EndDebug ( -> ) . Breakpoints ( ),Single-step Mode ( ) "Single-step mode" . (breakpoints), (single-step) . (single-step) : , (online) . 2- 62 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 125. 2. STEP 7 (single-step) CPU, . "debug mode" ( ), ProgramStatus ( ) . CPU HOLD (breakpoint), (step-by-step) HOLD. (breakpoints) : Debug -> Set Breakpoint ( -> ). . : Debug -> Breakpoints Active( -> ). CPU , CPU HOLD (. . 2.12).. 2.12 SCL- () , : Debug -> Execute Next Statement( -> ). , . : View -> Symbolic Representation ( -> ).Automating with STEP 7 in STL and SCL2- 63 STEP 7 STL SCL 126. 2. STEP 7 : Debug -> Resume ( -> ) , . : Debug -> Execute toSelection ( -> ) , . : Debug -> Edit Breakpoints ( -> ). : Debug -> Breakpoints Active( -> ).: Debug -> End Debug ( -> ) .: : Debug -> Execute Next Statement( -> ) Debug -> Execute toSelection ( -> ) . , , CPU.2- 64Automating with STEP 7 in STL and SCL STEP 7 STL SCL 127. 3 SIMATIC S7- CPU SIMATIC S7-300/400, ( ) () . STL SCL. 24 "". , ; , . .3.1 CPU (operating system) (user program). - , , . , .. - CPU, , , . , , , . (user program) - ( - ), , () .3.1.1 , CPU . , , , (. . 3.1). , , (priority class), ("mutualinterruptibility" - ) , .Automating with STEP 7 in STL and SCL 3- 1 STEP 7 STL SCL 128. 3. SIMATIC S7- - . 3.1 (main) , CPU. (main) , CPU . () . . , CPU . () - , . , CPU , (startup routine). , CPU PG. , , S7-300 ("complete restart" - " "), S7-400 , , ("warm restart" - " ").3-2 Automating with STEP 7 in STL and SCL STEP 7 STL SCL 129. 3. SIMATIC S7- (main) 1, . 1. 1, , CPU , , 1. , , - . ( ), CPU ( ["watchdog", ], ["time-of-day"] ..) , . - , , , , . - , , , . CPU; CPU , STEP 7.3.1.2 3.1 SIMATIC S7 ( ). 3.1 SIMATIC S7 OB 1 OB 1 TOD 22 24 OB 10 OB 17 (, ) ;362 24 OB 20 OB 23 Watchdog 7 15 2 24 OB 30 OB 38 (, 100 ) I/O 16 23 2 24 OB 40 OB 47 ; 25 OB 60 OB 70 - I/O25 2 26OB 72 CPU 28 2 28OB 73 2524 26 , (, [time2)OB 8026 26error], , 2)OB 81 OB 84, 86, 8726 2 26 / , /2)OB 852624 26) 1) 29 OB 90Automating with STEP 7 in STL and SCL3-3 STEP 7 STL SCL 130. 3. SIMATIC S7- 3.1 SIMATIC S7 () PLC27 OB 100, 101, 102 , , OB 121, OB 122 (, I/O ) .1) . 2) : 28 CPU. 3.1 . CPU . CPU. OB 90 ( ) OB 1 , OB 1, . OB 100 () OB 101 ( ); 27. , , 28. . , CPU. ( ) 0. ; CPU OB 85 ("Program Processing Error" - " ") STOP. (L-) ( 18.1.5 " ").3.1.3 CPU , . CPU HardwareConfiguration , . . CPU . STEP 7 . Sturtup ( ) ("cold restart" [" "] /("warm restart" [" "]); "Ready" ; , " ". 3-4Automating with STEP 7 in STL and SCL STEP 7 STL SCL 131. 3. SIMATIC S7- Cycle/clock memory (/ )/ ; ; ; ; . Retentive memory ( ) , ; . Memory () ( ); L- . Interrupts () , (time-delay interrupts), ( ) . Time-of-day Interrupts ( ) , . Cyclic Interrupts ( ) , . Diagnostics/Clock ( / ) STOP; ; . Protection ( ) , . Multicomputing ( ) CPU. Integrated I/O ( I/O) I/O. CPU , . , , .3.2 , , . STEP 7 , . (self-contained) . "" ("block"). - , , .Automating with STEP 7 in STL and SCL 3-5 STEP 7 STL SCL 132. 3. SIMATIC S7-3.2.1 (Block Types) : STL : User blocks ( ) - , . System blocks ( ) - , . Standard blocks ( ) - , ,, FM CP. (User blocks) "" - . , . OB (Organization blocks) . CPU , , . OB 1. , , . FB (Function blocks) , .