| Вид документа | Інструкція з експлуатації |
|---|---|
| Виробник | SIEMENS |
| Код документа | S7-1200_Instruction_manual |
| Сторінок | 1418 |
| Мова документа | англійська |
| Розмір файлу | 34.5 МБ |
Текст документа
Preface
Product overview 1
New features 2
STEP 7 programming
SIMATIC software 3
Installation 4
S7
S7-1200 Programmable controller PLC concepts 5
Device configuration 6
System Manual Programming concepts 7
Basic instructions 8
Extended instructions 9
Technology instructions 10
Communication 11
Web server 12
Communication processor
and Modbus TCP 13
TeleService communication
(SMTP email) 14
Online and diagnostic tools 15
Technical specifications A
Calculating a power budget B
Ordering Information C
Device exchange and spare
parts compatibility D
V4.5 05/2021
A5E02486680-AO
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage
to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices
referring only to property damage have no safety alert symbol. These notices shown below are graded according to
the degree of danger.
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 can result if proper precautions are not taken.
NOTICE
indicates that property damage can 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 safety alert symbol may also include a warning relating to property
damage.
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 Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must 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 permissible ambient
conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may
be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this
publication is reviewed regularly and any necessary corrections are included in subsequent editions.
Siemens AG A5E02486680-AO Copyright © Siemens AG 2021.
Digital Industries Ⓟ 04/2021 Subject to change All rights reserved
Postfach 48 48
90026 NÜRNBERG
GERMANY
Preface
Purpose of the manual
The S7-1200 series is a line of programmable logic controllers (PLCs) that can control a variety
of automation applications. Compact design, low cost, and a powerful instruction set make the
S7-1200 a perfect solution for controlling a wide variety of applications. The S7-1200 models
and the Windows-based STEP 7 programming tool (Page 37) give you the flexibility you need
to solve your automation problems.
This manual provides information about installing and programming the S7-1200 PLCs and is
designed for engineers, programmers, installers, and electricians who have a general
knowledge of programmable logic controllers.
Required basic knowledge
To understand this manual, it is necessary to have a general knowledge of automation and
programmable logic controllers.
Scope of the manual
This manual describes the following products:
• STEP 7 Basic and Professional (Page 37)
• S7-1200 CPU firmware release V4.5
For a complete list of the S7-1200 products described in this manual, refer to the technical
specifications (Page 1183).
Certification, CE label, C-Tick, and other approvals
Refer to the technical specifications (Page 1183) for more information.
Service and support
In addition to our documentation, Siemens offers technical expertise on the Internet and on the
customer support web site (http://support.industry.siemens.com).
Contact your Siemens distributor or sales office for assistance in answering any technical
questions, for training, or for ordering S7 products. Because your sales representatives are
technically trained and have the most specific knowledge about your operations, process and
industry, as well as about the individual Siemens products that you are using, they can provide
the fastest and most efficient answers to any problems you might encounter.
S7-1200 Programmable controller
System Manual, V4.5 05/2021, A5E02486680-AO 3
Preface
Documentation and information
S7-1200 and STEP 7 provide a variety of documentation and other resources for finding the
technical information that you require.
• The S7-1200 Programmable Controller System Manual provides specific information about
the operation, programming, and the specifications for the complete S7-1200 product
family.
The system manual is available as an electronic (PDF) manuals. You can download or view
this and other electronic manuals from the Siemens Industry Online Support Web site (http://
support.industry.siemens.com). The system manual is also available on the Documents Disk
that ships with every S7-1200 CPU.
• The online STEP 7 information system provides immediate access to the conceptual
information and specific instructions that describe the operation and functionality of the
programming package and basic operation of SIMATIC CPUs.
• The Siemens Industry Online Support Web site (http://support.industry.siemens.com)
provides access to the electronic (PDF) versions of the SIMATIC documentation set, including
the system manual, and the STEP 7 information system. Existing documents are available
from the Product Support link. With this online documentation access, you can also drag and
drop topics from various documents to create your own custom manual. Updates to previous-
published system manuals are also available from Siemens Industry Online Support.
You can access online documentation by clicking "mySupport" from the left side of the page
and selecting "Documentation" from the navigation choices. To use the mySupport
Documentation features, you must sign up as a registered user.
• The Siemens Industry Online Support Web site also provides FAQs and other helpful
documents for S7-1200 and STEP 7.
• You can also follow or join product discussions on the Service & Support technical forum
(https://support.industry.siemens.com/tf/ww/en/?
Language=en&siteid=csius&treeLang=en&groupid=4000002&extranet=standard&viewreg
=WW&nodeid0=34612486). These forums allow you to interact with various product
experts.
– Forum for S7-1200 (https://support.industry.siemens.com/tf/ww/en/threads/237?
title=simatic-s7-1200&skip=0&take=10&orderBy=LastPostDate+desc)
– Forum for STEP 7 Basic (https://support.industry.siemens.com/tf/ww/en/threads/243?
title=step-7-tia-portal&skip=0&take=10&orderBy=LastPostDate+desc)
Security information
Siemens provides products and solutions with industrial security functions that support the
secure operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security
concept. Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems,
machines and networks. Such systems, machines and components should only be connected to
an enterprise network or the internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
S7-1200 Programmable controller
4 System Manual, V4.5 05/2021, A5E02486680-AO
Preface
For additional information on industrial security measures that may be implemented, please
visit (https://www.siemens.com/industrialsecurity).
Siemens' products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customers' exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
visit (https://www.siemens.com/industrialsecurity).
Maintaining operational safety of your plant
Maintaining operational safety of your plant
Note
Important note for maintaining operational safety of your plant
Plants with safety-related features are subject to special operational safety requirements on the
part of the operator. Even suppliers are required to observe special measures during product
monitoring. For this reason, we inform you in the form of personal notifications about product
developments and features that are (or could be) relevant to operation of systems from a safety
perspective.
By subscribing to the appropriate notifications, you will ensure that you are always up-to-date
and able to make changes to your system, when necessary.
Log onto Industry Online Support. Go to the following links and, on the side, right click on "email
on update":
• SIMATIC S7-300/S7-300F (https://support.industry.siemens.com/cs/ww/en/ps/13751)
• SIMATIC S7-400/S7-400H/S7-400F/FH (https://support.industry.siemens.com/cs/ww/en/ps/
13828)
• SIMATIC WinAC RTX (F) (https://support.industry.siemens.com/cs/ww/en/ps/13915)
• SIMATIC S7-1500/SIMATIC S7-1500F (https://support.industry.siemens.com/cs/ww/en/ps/
13716)
• SIMATIC S7-1200/SIMATIC S7-1200F (https://support.industry.siemens.com/cs/ww/en/ps/
13683)
• Distributed I/O (https://support.industry.siemens.com/cs/ww/en/ps/14029)
• STEP 7 TIA Portal (https://support.industry.siemens.com/cs/ww/en/ps/14667)
S7-1200 Programmable controller
System Manual, V4.5 05/2021, A5E02486680-AO 5
Preface
S7-1200 Programmable controller
6 System Manual, V4.5 05/2021, A5E02486680-AO
Table of contents
Preface ................................................................................................................................................... 3
1 Product overview ................................................................................................................................. 27
1.1 Introducing the S7-1200 PLC .............................................................................................. 27
1.2 Expansion capability of the CPU ......................................................................................... 31
1.3 Basic HMI panels ................................................................................................................ 32
2 New features ....................................................................................................................................... 35
3 STEP 7 programming software ............................................................................................................ 37
3.1 System requirements ......................................................................................................... 37
3.2 Different views to make the work easier.............................................................................. 39
3.3 Compatibility between STEP 7 and the S7-1200.................................................................. 40
4 Installation........................................................................................................................................... 43
4.1 Guidelines for installing S7-1200 devices............................................................................ 43
4.2 Power budget .................................................................................................................... 44
4.3 Installation and removal procedures ................................................................................... 46
4.3.1 Mounting dimensions for the S7-1200 devices ................................................................... 46
4.3.2 Installing and removing the CPU......................................................................................... 49
4.3.3 Installing and removing an SB, CB, or BB............................................................................. 51
4.3.4 Installing and removing an SM ........................................................................................... 53
4.3.5 Installing and removing a CM or CP .................................................................................... 54
4.3.6 Removing and reinstalling the S7-1200 terminal block connector ....................................... 55
4.3.7 Installing and removing the expansion cable ...................................................................... 56
4.4 Wiring guidelines ............................................................................................................... 58
5 PLC concepts ........................................................................................................................................ 65
5.1 Execution of the user program ........................................................................................... 65
5.1.1 Operating modes of the CPU .............................................................................................. 68
5.1.2 Processing the scan cycle in RUN mode .............................................................................. 71
5.1.3 Organization blocks (OBs) .................................................................................................. 72
5.1.3.1 Program cycle OB............................................................................................................... 72
5.1.3.2 Startup OB ......................................................................................................................... 73
5.1.3.3 Time delay interrupt OB ..................................................................................................... 73
5.1.3.4 Cyclic interrupt OB ............................................................................................................. 73
5.1.3.5 Hardware interrupt OB ....................................................................................................... 74
5.1.3.6 Time error interrupt OB ...................................................................................................... 75
5.1.3.7 Diagnostic error interrupt OB.............................................................................................. 76
5.1.3.8 Pull or plug of modules OB ................................................................................................. 78
5.1.3.9 Rack or station failure OB ................................................................................................... 79
5.1.3.10 Time of day OB .................................................................................................................. 79
5.1.3.11 Status OB........................................................................................................................... 80
S7-1200 Programmable controller
System Manual, V4.5 05/2021, A5E02486680-AO 7
Table of contents
5.1.3.12 Update OB ......................................................................................................................... 80
5.1.3.13 Profile OB........................................................................................................................... 81
5.1.3.14 MC-Servo and MC-Interpolator OB ...................................................................................... 81
5.1.3.15 MC-PreServo ...................................................................................................................... 81
5.1.3.16 MC-PostServo .................................................................................................................... 82
5.1.3.17 Event execution priorities and queuing............................................................................... 83
5.1.4 Monitoring and configuring the cycle time.......................................................................... 86
5.1.5 CPU memory ..................................................................................................................... 88
5.1.5.1 System and clock memory ................................................................................................. 90
5.1.6 Diagnostics buffer .............................................................................................................. 92
5.1.7 Time of day clock ............................................................................................................... 93
5.1.8 Configuring the outputs on a RUN-to-STOP transition.......................................................... 93
5.2 Data storage, memory areas, I/O and addressing ................................................................ 94
5.2.1 Accessing the data of the S7-1200 ..................................................................................... 94
5.3 Processing of analog values................................................................................................ 99
5.4 Data types ....................................................................................................................... 100
5.4.1 Bool, Byte, Word, and DWord data types ........................................................................... 101
5.4.2 Integer data types ............................................................................................................ 102
5.4.3 Floating-point real data types........................................................................................... 103
5.4.4 Time and Date data types................................................................................................. 103
5.4.5 Character and String data types........................................................................................ 105
5.4.6 Array data type ................................................................................................................ 107
5.4.7 Data structure data type .................................................................................................. 108
5.4.8 PLC data type ................................................................................................................... 108
5.4.9 Variant pointer data type.................................................................................................. 109
5.4.10 Accessing a "slice" of a tagged data type........................................................................... 109
5.4.11 Accessing a tag with an AT overlay ................................................................................... 110
5.5 Using a memory card ....................................................................................................... 112
5.5.1 Inserting a memory card in the CPU ................................................................................. 113
5.5.2 Configuring the startup parameter of the CPU before copying the project to the memory
card................................................................................................................................. 115
5.5.3 Transfer card.................................................................................................................... 115
5.5.4 Program card ................................................................................................................... 118
5.5.5 Using a memory card for protecting confidential PLC configuration data............................ 121
5.5.6 Firmware update.............................................................................................................. 123
5.6 Recovery from a lost password ......................................................................................... 126
6 Device configuration.......................................................................................................................... 127
6.1 Inserting a CPU ................................................................................................................ 128
6.2 Uploading the configuration of a connected CPU .............................................................. 129
6.3 Adding modules to the configuration ............................................................................... 131
6.4 Configuration control ....................................................................................................... 132
6.4.1 Advantages and applications of configuration control ....................................................... 132
6.4.2 Configuring the central installation and optional modules................................................. 133
6.4.3 Example of configuration control...................................................................................... 139
6.5 Changing a device ........................................................................................................... 142
6.6 Configuring the operation of the CPU ............................................................................... 143
S7-1200 Programmable controller
8 System Manual, V4.5 05/2021, A5E02486680-AO
Table of contents
6.6.1 Overview ......................................................................................................................... 143
6.6.2 Configuring digital input filter times ................................................................................. 144
6.6.3 Pulse catch ...................................................................................................................... 146
6.7 Configuring multilingual support...................................................................................... 147
6.8 Protection & security ........................................................................................................ 149
6.8.1 Using the security wizard to set PLC security settings ........................................................ 149
6.8.2 Protection of confidential PLC configuration data .............................................................. 150
6.8.3 Access level protection for the CPU ................................................................................... 152
6.8.4 Configuring connection mechanisms................................................................................ 154
6.8.4.1 Setting access mechanism for remote partners ................................................................. 154
6.8.4.2 Enabling secure PG/PC and HMI communication and creating certificates .......................... 155
6.8.5 External load memory...................................................................................................... 156
6.8.6 Know-how protection ...................................................................................................... 156
6.8.7 Copy protection ............................................................................................................... 157
6.9 Configuring the parameters of the modules...................................................................... 158
6.10 Configuring the CPU for communication........................................................................... 160
6.11 Time synchronization....................................................................................................... 161
7 Programming concepts...................................................................................................................... 165
7.1 Guidelines for designing a PLC system .............................................................................. 165
7.2 Structuring your user program ......................................................................................... 166
7.3 Using blocks to structure your program ............................................................................ 167
7.3.1 Organization block (OB) ................................................................................................... 168
7.3.2 Function (FC)................................................................................................................... 170
7.3.3 Function block (FB) .......................................................................................................... 171
7.3.4 Data block (DB)................................................................................................................ 172
7.3.5 Creating reusable code blocks .......................................................................................... 174
7.3.6 Passing parameters to blocks............................................................................................ 174
7.4 Understanding data consistency....................................................................................... 177
7.5 Programming language.................................................................................................... 178
7.5.1 Ladder logic (LAD) ........................................................................................................... 178
7.5.2 Function Block Diagram (FBD) .......................................................................................... 179
7.5.3 SCL.................................................................................................................................. 179
7.5.3.1 SCL program editor .......................................................................................................... 180
7.5.3.2 SCL expressions and operations........................................................................................ 181
7.5.3.3 Indexed addressing with PEEK and POKE instructions........................................................ 184
7.5.4 EN and ENO for LAD, FBD and SCL.................................................................................... 186
7.6 Downloading the elements of your program..................................................................... 188
7.7 Synchronizing the online CPU and offline project .............................................................. 191
7.8 Uploading from the online CPU ........................................................................................ 193
7.8.1 Comparing the online CPU to the offline CPU .................................................................... 193
7.9 Debugging and testing the program................................................................................. 193
7.9.1 Monitor and modify data in the CPU ................................................................................. 193
7.9.2 Watch tables and force tables........................................................................................... 194
7.9.3 Cross reference to show usage ......................................................................................... 195
7.9.4 Call structure to examine the calling hierarchy.................................................................. 195
S7-1200 Programmable controller
System Manual, V4.5 05/2021, A5E02486680-AO 9
Table of contents
8 Basic instructions............................................................................................................................... 197
8.1 Bit logic operations .......................................................................................................... 197
8.1.1 Bit logic instructions......................................................................................................... 197
8.1.2 Set and reset instructions ................................................................................................. 200
8.1.3 Positive and negative edge instructions ............................................................................ 202
8.2 Timer operations ............................................................................................................. 205
8.3 Counter operations .......................................................................................................... 213
8.4 Comparator operations .................................................................................................... 218
8.4.1 Compare values instructions ............................................................................................ 218
8.4.2 IN_Range (Value within range) and OUT_Range (Value outside range) .............................. 219
8.4.3 OK (Check validity) and NOT_OK (Check invalidity) ........................................................... 219
8.4.4 Variant and array comparison instructions ........................................................................ 220
8.4.4.1 Equality and non-equality comparison instructions ........................................................... 220
8.4.4.2 Null comparsion instructions............................................................................................ 221
8.4.4.3 IS_ARRAY (Check for ARRAY)............................................................................................. 221
8.5 Math functions ................................................................................................................ 222
8.5.1 CALCULATE (Calculate)..................................................................................................... 222
8.5.2 Add, subtract, multiply and divide instructions ................................................................. 223
8.5.3 MOD (return remainder of division).................................................................................. 224
8.5.4 NEG (Create twos complement) ....................................................................................... 225
8.5.5 INC (Increment) and DEC (Decrement) ............................................................................. 226
8.5.6 ABS (Form absolute value) ............................................................................................... 226
8.5.7 MIN (Get minimum) and MAX (Get maximum) ................................................................. 227
8.5.8 LIMIT (Set limit value) ...................................................................................................... 228
8.5.9 Exponent, logarithm, and trigonometry instructions......................................................... 229
8.6 Move operations .............................................................................................................. 231
8.6.1 MOVE (Move value), MOVE_BLK (Move block), UMOVE_BLK (Move block uninterruptible),
and MOVE_BLK_VARIANT (Move block)............................................................................. 231
8.6.2 Deserialize ....................................................................................................................... 234
8.6.3 Serialize........................................................................................................................... 236
8.6.4 FILL_BLK (Fill block) and UFILL_BLK (Fill block uninterruptible) .......................................... 239
8.6.5 SWAP (Swap bytes) .......................................................................................................... 240
8.6.6 LOWER_BOUND: (Read out ARRAY low limit) ..................................................................... 241
8.6.7 UPPER_BOUND: (Read out ARRAY high limit)..................................................................... 242
8.6.8 Read / Write memory instructions..................................................................................... 244
8.6.8.1 PEEK and POKE (SCL only) ................................................................................................ 244
8.6.8.2 Read and write big and little Endian instructions (SCL)...................................................... 245
8.6.9 Variant instructions.......................................................................................................... 247
8.6.9.1 VariantGet (Read VARIANT tag value) ............................................................................... 247
8.6.9.2 VariantPut (Write VARIANT tag value) ............................................................................... 248
8.6.9.3 CountOfElements (Get number of ARRAY elements) ......................................................... 249
8.6.10 Legacy instructions .......................................................................................................... 250
8.6.10.1 FieldRead (Read field) and FieldWrite (Write field) instructions........................................... 250
8.6.11 SCATTER .......................................................................................................................... 252
8.6.12 SCATTER_BLK................................................................................................................... 255
8.6.13 GATHER ........................................................................................................................... 260
8.6.14 GATHER_BLK .................................................................................................................... 264
8.7 Conversion operations ..................................................................................................... 269
S7-1200 Programmable controller
10 System Manual, V4.5 05/2021, A5E02486680-AO
Table of contents
8.7.1 CONV (Convert value) ...................................................................................................... 269
8.7.2 Conversion instructions for SCL ........................................................................................ 270
8.7.3 ROUND (Round numerical value) and TRUNC (Truncate numerical value) .......................... 273
8.7.4 CEIL and FLOOR (Generate next higher and lower integer from floating-point number) ..... 274
8.7.5 SCALE_X (Scale) and NORM_X (Normalize)....................................................................... 275
8.7.6 Variant conversion instructions ........................................................................................ 277
8.7.6.1 VARIANT_TO_DB_ANY (Convert VARIANT to DB_ANY) ....................................................... 277
8.7.6.2 DB_ANY_TO_VARIANT (Convert DB_ANY to VARIANT) ....................................................... 279
8.8 Program control operations.............................................................................................. 280
8.8.1 JMP (Jump if RLO = 1), JMPN (Jump if RLO = 0), and Label (Jump label) instructions .......... 280
8.8.2 JMP_LIST (Define jump list) .............................................................................................. 281
8.8.3 SWITCH (Jump distributor) ............................................................................................... 282
8.8.4 RET (Return) .................................................................................................................... 283
8.8.5 ENDIS_PW (Enable/disable CPU passwords)....................................................................... 285
8.8.6 RE_TRIGR (Restart cycle monitoring time) ......................................................................... 288
8.8.7 STP (Exit program) ........................................................................................................... 289
8.8.8 GET_ERROR and GET_ERROR_ID (Get error and error ID locally) instructions....................... 289
8.8.9 RUNTIME (Measure program runtime) .............................................................................. 292
8.8.10 SCL program control statements....................................................................................... 294
8.8.10.1 Overview of SCL program control statements ................................................................... 294
8.8.10.2 IF-THEN statement ........................................................................................................... 295
8.8.10.3 CASE statement ............................................................................................................... 296
8.8.10.4 FOR statement ................................................................................................................. 297
8.8.10.5 WHILE-DO statement ....................................................................................................... 298
8.8.10.6 REPEAT-UNTIL statement .................................................................................................. 299
8.8.10.7 CONTINUE statement ....................................................................................................... 300
8.8.10.8 EXIT statement ................................................................................................................ 300
8.8.10.9 GOTO statement .............................................................................................................. 301
8.8.10.10 RETURN statement ........................................................................................................... 301
8.9 Word logic operations ...................................................................................................... 302
8.9.1 AND, OR, and XOR logic operation instructions ................................................................ 302
8.9.2 INV (Create ones complement)......................................................................................... 303
8.9.3 DECO (Decode) and ENCO (Encode) instructions............................................................... 303
8.9.4 SEL (Select), MUX (Multiplex), and DEMUX (Demultiplex) instructions .............................. 304
8.10 Shift and rotate................................................................................................................ 307
8.10.1 SHR (Shift right) and SHL (Shift left) instructions .............................................................. 307
8.10.2 ROR (Rotate right) and ROL (Rotate left) instructions......................................................... 308
9 Extended instructions........................................................................................................................ 309
9.1 Date, time-of-day, and clock functions.............................................................................. 309
9.1.1 Date and time-of-day instructions..................................................................................... 309
9.1.2 Clock functions ................................................................................................................ 312
9.1.3 TimeTransformationRule data structure ............................................................................ 314
9.1.4 SET_TIMEZONE (Set timezone)......................................................................................... 315
9.1.5 RTM (Runtime meters) ..................................................................................................... 316
9.2 String and character......................................................................................................... 318
9.2.1 String data overview ........................................................................................................ 318
9.2.2 S_MOVE (Move character string) ...................................................................................... 319
9.2.3 String conversion instructions .......................................................................................... 319
S7-1200 Programmable controller
System Manual, V4.5 05/2021, A5E02486680-AO 11
Table of contents
9.2.3.1 S_CONV, STRG_VAL, and VAL_STRG (Convert to/from character string and number)
instructions ..................................................................................................................... 319
9.2.3.2 Strg_TO_Chars and Chars_TO_Strg (Convert to/from character string and array of CHAR)
instructions ..................................................................................................................... 328
9.2.3.3 ATH and HTA (Convert to/from ASCII string and hexadecimal number) instructions............ 330
9.2.4 String operation instructions ............................................................................................ 331
9.2.4.1 MAX_LEN (Maximum length of a character string)............................................................ 332
9.2.4.2 LEN (Determine the length of a character string) .............................................................. 332
9.2.4.3 CONCAT (Combine character strings)................................................................................ 333
9.2.4.4 LEFT, RIGHT, and MID (Read substrings in a character string) instructions .......................... 334
9.2.4.5 DELETE (Delete characters in a character string) ............................................................... 335
9.2.4.6 INSERT (Insert characters in a character string) ................................................................. 336
9.2.4.7 REPLACE (Replace characters in a character string) ........................................................... 337
9.2.4.8 FIND (Find characters in a character string)....................................................................... 338
9.2.5 Runtime information........................................................................................................ 339
9.2.5.1 GetSymbolName (Read out a tag on the input parameter) ................................................ 339
9.2.5.2 GetSymbolPath (Query composite global name of the input parameter assignment) ......... 342
9.2.5.3 GetInstanceName (Read out name of the block instance) ................................................. 344
9.2.5.4 GetInstancePath (Query composite global name of the block instance) ............................. 346
9.2.5.5 GetBlockName (Read out name of the block) .................................................................... 348
9.3 Distributed I/O (PROFINET, PROFIBUS, or AS-i) ................................................................... 350
9.3.1 Distributed I/O Instructions............................................................................................... 350
9.3.2 RDREC and WRREC (Read/write data record)...................................................................... 352
9.3.3 GETIO (Read process image)............................................................................................. 355
9.3.4 SETIO (Transfer process image) ........................................................................................ 356
9.3.5 GETIO_PART (Read process image area) ............................................................................ 357
9.3.6 SETIO_PART (Transfer process image area)........................................................................ 358
9.3.7 RALRM (Receive interrupt)................................................................................................ 359
9.3.8 D_ACT_DP (Enable/disable PROFINET IO devices) .............................................................. 362
9.3.9 STATUS parameter for RDREC, WRREC, and RALRM ............................................................ 367
9.3.10 Others ............................................................................................................................. 371
9.3.10.1 DPRD_DAT and DPWR_DAT (Read/write consistent data) .................................................... 371
9.3.10.2 RCVREC (I-device/I-slave receive data record) .................................................................... 374
9.3.10.3 PRVREC (I-device/I-slave make data record available) ......................................................... 376
9.3.10.4 DPNRM_DG (Read diagnostic data from a PROFIBUS DP slave) ........................................... 378
9.4 PROFIenergy .................................................................................................................... 380
9.5 Interrupts ........................................................................................................................ 382
9.5.1 ATTACH and DETACH (Attach/detach an OB and an interrupt event) instructions ................ 382
9.5.2 Cyclic interrupts ............................................................................................................... 385
9.5.2.1 SET_CINT (Set cyclic interrupt parameters)........................................................................ 385
9.5.2.2 QRY_CINT (Query cyclic interrupt parameters) .................................................................. 387
9.5.3 Time of day interrupts ...................................................................................................... 388
9.5.3.1 SET_TINTL (Set time of day interrupt) ............................................................................... 388
9.5.3.2 CAN_TINT (Cancel time of day interrupt) .......................................................................... 390
9.5.3.3 ACT_TINT (Activate time of day interrupt) ......................................................................... 390
9.5.3.4 QRY_TINT (Query status of time of day interrupt) ............................................................. 391
9.5.4 Time delay interrupts ....................................................................................................... 392
9.5.5 DIS_AIRT and EN_AIRT (Delay/enable execution of higher priority interrupts and
asynchronous error events) instructions ........................................................................... 394
9.6 Alarms............................................................................................................................. 395
S7-1200 Programmable controller
12 System Manual, V4.5 05/2021, A5E02486680-AO
Table of contents
9.6.1 Gen_UsrMsg (Generate user diagnostic alarms)................................................................ 395
9.7 Diagnostics (PROFINET or PROFIBUS) ................................................................................ 397
9.7.1 Diagnostic instructions..................................................................................................... 397
9.7.2 RD_SINFO (Read current OB start information) ................................................................. 398
9.7.3 LED (Read LED status) ...................................................................................................... 407
9.7.4 Get_IM_Data (Read the identification and maintenance data) ........................................... 408
9.7.5 Get_Name (Read the name of a PROFINET IO device) ........................................................ 409
9.7.6 GetStationInfo (Read the IP or MAC address of a PROFINET IO device) ............................... 415
9.7.7 DeviceStates instruction ................................................................................................... 423
9.7.7.1 DeviceStates example configurations................................................................................ 424
9.7.8 ModuleStates instruction ................................................................................................. 427
9.7.8.1 ModuleStates example configurations .............................................................................. 429
9.7.9 GET_DIAG (Read diagnostic information) .......................................................................... 432
9.7.10 GetSMCInfo (Reading out information about the memory card) ........................................ 438
9.7.11 Diagnostic events for distributed I/O ................................................................................. 441
9.8 Pulse ............................................................................................................................... 442
9.8.1 CTRL_PWM (Pulse width modulation) ............................................................................... 442
9.8.2 CTRL_PTO (Pulse train output) .......................................................................................... 444
9.8.3 Operation of the pulse outputs......................................................................................... 447
9.8.4 Configuring a pulse channel for PWM or PTO .................................................................... 448
9.9 Recipes and Data logs ...................................................................................................... 453
9.9.1 Recipes ........................................................................................................................... 453
9.9.1.1 Recipe overview....................................................................................................Показано початок документа. Повний текст — у PDF за посиланням вище.
Позиції каталогу з цим документом
Документ виробника, опублікований як довідковий матеріал на обладнання, яке ми постачаємо. Правовласник може попросити прибрати його — приберемо.
