Easy Book SIEMENS_S7_1200_KTP400_BASIC_STARTERKIT Ver. 01 197349 An En SIEMENS S7 1200 KTP400 BASIC STARTERKIT

User Manual: Pdf SIEMENS_S7_1200_KTP400_BASIC_STARTERKIT - Ver. 01 PLC starter kit Siemens S7-1200+KTP400 BASIC 6AV6651-7KA01-3AA4 115 V AC, 230 V AC from Conrad.com

Open the PDF directly: View PDF PDF.
Page Count: 364 [warning: Documents this large are best viewed by clicking the View PDF Link!]

Easy Book
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
___________________
SIMATIC
S7-1200
Easy Book
Manual
03/2014
A5E02486774
-AF
Preface
Introducing the powerful and
flexible S7-1200
1
STEP 7 makes the work
easy
2
Getting started
3
PLC concepts made easy
4
Easy to create the device
configuration
5
Programming made easy
6
Easy to communicate
between devices
7
PID is easy
8
Web server for easy Internet
connectivity
9
Motion control is easy
10
Easy to use the online tools
11
IO-Link is easy
12
Technical specifications
A
Exchanging a V3.0 CPU for
a V4.0 CPU
B
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
GERMANY
Order number: 6ES7298-8FA30-8BQ0
12/2013 Technical data subject to change
Copyright © Siemens AG 2014.
All rights reserved
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.
Easy Book
Manual, 03/2014, A5E02486774-AF 3
Preface
Welcome to the world of S7-1200. The SIMATIC S7-1200 compact controller is the modular,
space-saving controller for small automation systems that require either simple or advanced
functionality for logic, HMI and networking. The compact design, low cost, and powerful
features make the S7-1200 a perfect solution for controlling small applications.
As part of the SIMATIC commitment to "totally integrated automation" (TIA), the S7-1200
product family and the TIA Portal programming software give you the flexibility you need to
solve your automation needs.
The S7-1200 helps to make the most challenging tasks easy!
The SIMATIC S7-1200 controller solution, designed for the "compact" controller class, is
comprised of the SIMATIC S7-1200 controller and SIMATIC HMI Basic panels that can both
be programmed with the TIA Portal engineering software. The ability to program both
devices using the same engineering software significantly reduces development costs. The
TIA Portal includes STEP 7 for S7-1200 programming and WinCC for designing Basic panel
projects.
The S7
-1200 compact controller includes:
Built-in PROFINET
High-speed I/O capable of motion control, onboard
analog inputs to minimize space requirements and
the need for additional I/O, 4 pulse generators for
pulse-train and pulse-width applications (Page 67) ,
and up to 6 high-speed counters
On-board I/O points built into the CPU modules
provide from 6 to 14 input points and from 4 to 10
output points.
Signal modules for DC, relay, or
analog I/O
expand the number of I/O points, and
innovative signal boards snap onto the front
of the CPU
to provide additional I/O
(Page
18).
The
SIMATIC HMI Basic panels (Page 22)
were designed specifically for the S7
-1200.
This Easy Book provides an introduction to
the S7
-1200 PLC. The following pages offer
an overview of the many features and
capabilities of the devices.
For additional information, refer to the
S7-1200 programmable controller system manual
. For
information about UL and FM certification, CE labeling, C-Tick and other standards, refer to
the Technical specifications (Page 281).
Preface
Easy Book
4 Manual, 03/2014, A5E02486774-AF
This manual describes the following products:
STEP 7 V13 SP1 Basic and Professional
S7-1200 CPU firmware release V4.0
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 system manual provides specific information about the operation,
programming, and the specifications for the complete S7-1200 product family. In addition
to the system manual, the S7-1200 Easy Book provides a more general overview to the
capabilities of the S7-1200 family.
Both the system manual and the Easy Book are available as electronic (PDF) manuals.
The electronic manuals can be downloaded from the customer support web site and can
also be found on the documentation 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.
My Documentation Manager accesses the electronic (PDF) versions of the SIMATIC
documentation set, including the system manual, the Easy Book, and the STEP 7
information system. With My Documentation Manager, you can drag and drop topics from
various documents to create your own custom manual.
The customer support entry portal (http://support.automation.siemens.com) provides a
link to My Documentation Manager under mySupport.
The customer support web site also provides podcasts, FAQs, and other helpful
documents for S7-1200 and STEP 7. The podcasts utilize short educational video
presentations that focus on specific features or scenarios in order to demonstrate the
interactions, convenience, and efficiency provided by STEP 7. Visit the following web
sites to access the collection of podcasts:
STEP 7 Basic web page (http://www.automation.siemens.com/mcms/simatic-
controller-software/en/step7/step7-basic/Pages/Default.aspx)
STEP 7 Professional web page (http://www.automation.siemens.com/mcms/simatic-
controller-software/en/step7/step7-professional/Pages/Default.aspx)
You can also follow or join product discussions on the Service & Support technical forum
(https://www.automation.siemens.com/WW/forum/guests/Conferences.aspx?Language=e
n&siteid=csius&treeLang=en&groupid=4000002&extranet=standard&viewreg=WW&nodei
d0=34612486). These forums allow you to interact with various product experts.
Forum for S7-1200
(https://www.automation.siemens.com/WW/forum/guests/Conference.aspx?SortField=
LastPostDate&SortOrder=Descending&ForumID=258&Language=en&onlyInternet=Fa
lse)
Forum for STEP 7 Basic
(https://www.automation.siemens.com/WW/forum/guests/Conference.aspx?SortField=
LastPostDate&SortOrder=Descending&ForumID=265&Language=en&onlyInternet=Fa
lse)
Preface
Easy Book
Manual, 03/2014, A5E02486774-AF 5
Service and support
In addition to our documentation, Siemens offers technical expertise on the Internet and on
the customer support web site (http://www.siemens.com/automation/).
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.
Security information
Siemens provides automation and drive products with industrial security functions that
support the secure operation of plants or machines. They are an important component in a
holistic industrial security concept. With this in mind, our products undergo continuous
development. We therefore recommend that you keep yourself informed with respect to our
product updates. Please find further information and newsletters on this subject at:
(http://support.automation.siemens.com)
To ensure the secure operation of a plant or machine it is also necessary to take suitable
preventive action (e.g. cell protection concept) and to integrate the automation and drive
components into a state-of-the-art holistic industrial security concept for the entire plant or
machine. Any third-party products that may be in use must also be taken into account.
Please find further information at: (http://www.siemens.com/industrialsecurity)
Preface
Easy Book
6 Manual, 03/2014, A5E02486774-AF
Easy Book
Manual, 03/2014, A5E02486774-AF 7
Table of contents
Preface ................................................................................................................................................... 3
1 Introducing the powerful and flexible S7-1200 ....................................................................................... 15
1.1 Introducing the S7-1200 PLC ....................................................................................................... 15
1.2 Expansion capability of the CPU.................................................................................................. 18
1.3 S7-1200 modules ......................................................................................................................... 21
1.4 Basic HMI panels ......................................................................................................................... 22
1.5 Mounting dimensions and clearance requirements ..................................................................... 23
1.6 New features ................................................................................................................................ 27
2 STEP 7 makes the work easy ............................................................................................................... 29
2.1 Easy to insert instructions into your user program ....................................................................... 30
2.2 Easy access to your favorite instructions from a toolbar ............................................................. 30
2.3 Easy to add inputs or outputs to LAD and FBD instructions ........................................................ 31
2.4 Expandable instructions ............................................................................................................... 31
2.5 Easy to change the operating mode of the CPU ......................................................................... 32
2.6 Easy to modify the appearance and configuration of STEP 7 ..................................................... 33
2.7 Project and global libraries for easy access ................................................................................ 33
2.8 Easy to select a version of an instruction .................................................................................... 34
2.9 Easy to drag and drop between editors ....................................................................................... 34
2.10 Changing the call type for a DB ................................................................................................... 35
2.11 Temporarily disconnecting devices from a network ..................................................................... 36
2.12 Easy to virtually "unplug" modules without losing the configuration ............................................ 37
3 Getting started ...................................................................................................................................... 39
3.1 Create a project............................................................................................................................ 39
3.2 Create tags for the I/O of the CPU ............................................................................................... 40
3.3 Create a simple network in your user program ............................................................................ 41
3.4 Use the PLC tags in the tag table for addressing the instructions ............................................... 43
3.5 Add a "box" instruction ................................................................................................................. 44
3.6 Use the CALCULATE instruction for a complex mathematical equation ..................................... 45
3.7 Add an HMI device to the project ................................................................................................. 47
3.8 Create a network connection between the CPU and HMI device ................................................ 48
3.9 Create an HMI connection to share tags ..................................................................................... 48
Table of contents
Easy Book
8 Manual, 03/2014, A5E02486774-AF
3.10 Create an HMI screen ................................................................................................................. 49
3.11 Select a PLC tag for the HMI element ........................................................................................ 50
4 PLC concepts made easy ..................................................................................................................... 51
4.1 Tasks performed every scan cycle ............................................................................................. 51
4.2 Operating modes of the CPU ...................................................................................................... 52
4.3 Execution of the user program .................................................................................................... 53
4.3.1 Processing the scan cycle in RUN mode .................................................................................... 54
4.3.2 OBs help you structure your user program ................................................................................. 55
4.3.3 Event execution priorities and queuing ....................................................................................... 55
4.4 Memory areas, addressing and data types ................................................................................. 58
4.4.1 Data types supported by the S7-1200 ........................................................................................ 60
4.4.2 Addressing memory areas .......................................................................................................... 62
4.4.3 Accessing a "slice" of a tagged data type ................................................................................... 64
4.4.4 Accessing a tag with an AT overlay ............................................................................................ 65
4.5 Pulse outputs .............................................................................................................................. 67
5 Easy to create the device configuration ................................................................................................. 71
5.1 Detecting the configuration for an unspecified CPU ................................................................... 72
5.2 Adding a CPU to the configuration .............................................................................................. 73
5.3 Changing a device ...................................................................................................................... 74
5.4 Adding modules to the configuration ........................................................................................... 74
5.5 Configuring the operation of the CPU and modules ................................................................... 76
5.5.1 System memory and clock memory provide standard functionality ............................................ 77
5.6 Configuring the IP address of the CPU ....................................................................................... 80
5.7 Protecting access to the CPU or code block is easy .................................................................. 82
5.7.1 Know-how protection ................................................................................................................... 84
5.7.2 Copy protection ........................................................................................................................... 85
6 Programming made easy ...................................................................................................................... 87
6.1 Easy to design your user program .............................................................................................. 87
6.1.1 Use OBs for organizing your user program ................................................................................ 89
6.1.2 FBs and FCs make programming the modular tasks easy ......................................................... 90
6.1.3 Data blocks provide easy storage for program data ................................................................... 92
6.1.4 Creating a new code block .......................................................................................................... 92
6.1.5 Creating reusable code blocks .................................................................................................... 93
6.1.6 Calling a code block from another code block ............................................................................ 94
6.2 Easy-to-use programming languages ......................................................................................... 94
6.2.1 Ladder logic (LAD) ...................................................................................................................... 94
6.2.2 Function Block Diagram (FBD) ................................................................................................... 95
6.2.3 SCL overview .............................................................................................................................. 96
6.2.4 SCL program editor ..................................................................................................................... 96
6.3 Powerful instructions make programming easy .......................................................................... 98
6.3.1 Providing the basic instructions you expect ................................................................................ 98
6.3.2 Compare and Move instructions ............................................................................................... 100
6.3.3 Conversion instructions ............................................................................................................. 101
Table of contents
Easy Book
Manual, 03/2014, A5E02486774-AF 9
6.3.4 Math made easy with the Calculate instruction ......................................................................... 103
6.3.5 Timers ........................................................................................................................................ 104
6.3.6 Counters ..................................................................................................................................... 109
6.3.7 Pulse-width modulation (PWM) .................................................................................................. 111
6.4 Easy to create data logs ............................................................................................................ 112
6.5 Easy to monitor and test your user program .............................................................................. 114
6.5.1 Watch tables and force tables .................................................................................................... 114
6.5.2 Cross reference to show usage ................................................................................................. 115
6.5.3 Call structure to examine the calling hierarchy .......................................................................... 116
6.5.4 Diagnostic instructions to monitor the hardware ........................................................................ 117
6.5.4.1 Reading the states of the LEDs on the CPU ............................................................................. 117
6.5.4.2 Instructions for reading the diagnostic status of the devices ..................................................... 117
6.6 High-speed counter (HSC) ......................................................................................................... 118
6.6.1 Operation of the high-speed counter ......................................................................................... 119
6.6.2 Configuration of the HSC ........................................................................................................... 125
7 Easy to communicate between devices ............................................................................................... 127
7.1 Creating a network connection .................................................................................................. 128
7.2 Communication options ............................................................................................................. 129
7.3 Number of asynchronous communication connections ............................................................. 131
7.4 PROFINET and PROFIBUS instructions ................................................................................... 132
7.5 PROFINET ................................................................................................................................. 133
7.5.1 Open user communication ......................................................................................................... 133
7.5.1.1 Ad hoc mode .............................................................................................................................. 134
7.5.1.2 Connection IDs for the Open user communication instructions ................................................. 134
7.5.1.3 Parameters for the PROFINET connection ............................................................................... 137
7.5.2 Configuring the Local/Partner connection path .......................................................................... 140
7.6 PROFIBUS ................................................................................................................................. 142
7.6.1 Communications services of the PROFIBUS CMs .................................................................... 144
7.6.2 Reference to the PROFIBUS CM user manuals ........................................................................ 145
7.6.3 Adding the CM 1243-5 (DP master) module and a DP slave .................................................... 145
7.6.4 Assigning PROFIBUS addresses to the CM 1243-5 module and DP slave .............................. 146
7.7 AS-i ............................................................................................................................................ 148
7.7.1 Adding the AS-i master CM 1243-2 and AS-i slave ................................................................... 149
7.7.2 Assigning an AS-i address to an AS-i slave .............................................................................. 150
7.8 S7 communication ..................................................................................................................... 153
7.8.1 GET and PUT instructions ......................................................................................................... 153
7.8.2 Creating an S7 connection ......................................................................................................... 154
7.8.3 GET/PUT connection parameter assignment ............................................................................ 155
7.9 GPRS ......................................................................................................................................... 156
7.9.1 Connection to a GSM network ................................................................................................... 156
7.10 PtP, USS, and Modbus communication protocols ..................................................................... 163
7.10.1 Point-to-point communication .................................................................................................... 163
7.10.2 Using the serial communication interfaces ................................................................................ 163
7.10.3 PtP instructions .......................................................................................................................... 164
7.10.4 USS instructions......................................................................................................................... 165
Table of contents
Easy Book
10 Manual, 03/2014, A5E02486774-AF
7.10.5 Modbus instructions .................................................................................................................. 167
8 PID is easy .......................................................................................................................................... 169
8.1 Inserting the PID instruction and technology object .................................................................. 171
8.2 PID_Compact instruction ........................................................................................................... 173
8.3 PID_Compact instruction ErrorBit parameters .......................................................................... 177
8.4 PID_3Step instruction ................................................................................................................ 179
8.5 PID_3Step instruction ErrorBit parameters ............................................................................... 186
8.6 Configuring the PID controller ................................................................................................... 188
8.7 Commissioning the PID controller ............................................................................................. 190
9 Web server for easy Internet connectivity ............................................................................................. 193
9.1 Easy to use the standard Web pages ....................................................................................... 194
9.2 Constraints that can affect the use of the Web server .............................................................. 196
9.2.1 Feature restrictions when the Internet options disable JavaScript ........................................... 197
9.2.2 Feature restrictions when the Internet options do not allow cookies ........................................ 198
9.3 Easy to create user-defined web pages .................................................................................... 198
9.3.1 Easy to create custom "user-defined" web pages .................................................................... 198
9.3.2 Constraints specific to user-defined Web pages....................................................................... 199
9.3.3 Configuration of a user-defined Web page ............................................................................... 200
9.3.4 Using the WWW instruction ...................................................................................................... 201
10 Motion control is easy .......................................................................................................................... 203
10.1 Phasing ..................................................................................................................................... 208
10.2 Configuring a pulse generator ................................................................................................... 210
10.3 Configuring the axis .................................................................................................................. 211
10.4 Configuring the TO_CommandTable_PTO ............................................................................... 214
10.5 Motion control instructions ........................................................................................................ 217
10.5.1 MC instruction overview ............................................................................................................ 217
10.5.2 MC_Power (Release/block axis) instruction .............................................................................. 217
10.5.3 MC_Reset (Confirm error) instruction ....................................................................................... 221
10.5.4 MC_Home (Home axis) instruction ........................................................................................... 222
10.5.5 MC_Halt (Pause axis) instruction .............................................................................................. 224
10.5.6 MC_MoveAbsolute (Position axis absolutely) instruction ......................................................... 226
10.5.7 MC_MoveRelative (Position axis relatively) instruction ............................................................ 228
10.5.8 MC_MoveVelocity (Move axis at predefined velocity) instruction ............................................. 230
10.5.9 MC_MoveJog (Move axis in jog mode) instruction ................................................................... 233
10.5.10 MC_CommandTable (Run axis commans as movement sequence) instruction ...................... 235
10.5.11 MC_ChangeDynamic (Change dynamc settings for the axis) instruction ................................. 237
10.5.12 MC_WriteParam (write parameters of a technology object) instruction .................................... 239
10.5.13 MC_ReadParam instruction (read parameters of a technology object) instruction .................. 241
10.6 Operation of motion control for S7-1200 ................................................................................... 242
10.6.1 CPU outputs used for motion control ........................................................................................ 242
10.6.2 Hardware and software limit switches for motion control .......................................................... 244
10.6.3 Homing ...................................................................................................................................... 247
10.6.3.1 Homing the axis ........................................................................................................................ 247
Table of contents
Easy Book
Manual, 03/2014, A5E02486774-AF 11
10.6.3.2 Configuration of homing parameters ......................................................................................... 249
10.6.3.3 Sequence for active homing ...................................................................................................... 251
10.7 Commissioning........................................................................................................................... 252
11 Easy to use the online tools................................................................................................................. 257
11.1 Going online and connecting to a CPU ...................................................................................... 257
11.2 Interacting with the online CPU .................................................................................................. 258
11.3 Going online to monitor the values in the CPU .......................................................................... 259
11.4 Displaying status of the user program is easy ........................................................................... 260
11.5 Using a watch table for monitoring the CPU .............................................................................. 260
11.6 Using the force table .................................................................................................................. 261
11.7 Capturing the online values of a DB to reset the start values .................................................... 264
11.8 Copying elements of the project ................................................................................................ 265
11.9 Comparing offline and online CPUs ........................................................................................... 266
11.10 Displaying the diagnostic events ................................................................................................ 267
11.11 Setting the IP address and time of day ...................................................................................... 267
11.12 Resetting to factory settings ....................................................................................................... 268
11.13 Updating firmware ...................................................................................................................... 269
11.14 Downloading an IP address to an online CPU ........................................................................... 270
11.15 Using the "unspecified CPU" to upload the hardware configuration .......................................... 271
11.16 Downloading in RUN mode ........................................................................................................ 272
11.16.1 Changing your program in RUN mode ...................................................................................... 273
11.17 Tracing and recording CPU data on trigger conditions .............................................................. 274
12 IO-Link is easy .................................................................................................................................... 275
12.1 Overview of IO-Link technology ................................................................................................. 275
12.2 Components of an IO-Link system............................................................................................. 275
12.3 After power-up............................................................................................................................ 275
12.4 IO-Link protocol .......................................................................................................................... 276
12.5 Configuration in the fieldbus ...................................................................................................... 276
12.6 IO-Link and your STEP 7 program............................................................................................. 276
12.7 The SM 1278 4xIO-Link Master ................................................................................................. 277
A Technical specifications ...................................................................................................................... 281
A.1 General technical specifications ................................................................................................ 281
A.2 CPU modules ............................................................................................................................. 289
A.3 Digital I/O modules ..................................................................................................................... 293
A.3.1 SB 1221, SB 1222, and SB 1223 digital input/output (DI, DQ, and DI/DQ)............................... 293
A.3.2 SM 1221 digital input (DI) .......................................................................................................... 296
A.3.3 SM 1222 digital output (DQ) ...................................................................................................... 297
Table of contents
Easy Book
12 Manual, 03/2014, A5E02486774-AF
A.3.4 SM 1223 VDC digital input/output (DI / DQ) ............................................................................. 299
A.3.5 SM 1223 120/230 VAC input / Relay output ............................................................................. 300
A.4 Specifications for the digital inputs and outputs ........................................................................ 302
A.4.1 24 VDC digital inputs (DI) .......................................................................................................... 302
A.4.2 120/230 VAC digital AC inputs .................................................................................................. 303
A.4.3 Digital outputs (DQ) ................................................................................................................... 304
A.5 Analog I/O modules ................................................................................................................... 306
A.5.1 SB 1231 and SB 1232 analog input (AI) and output (AQ) ........................................................ 306
A.5.2 SM 1231 analog input (AI) ........................................................................................................ 307
A.5.3 SM 1232 analog output (AQ) .................................................................................................... 308
A.5.4 SM 1234 analog input/output (AI/AQ) ....................................................................................... 308
A.5.5 Wiring diagrams for SM 1231 (AI), SM 1232 (AQ), and SM 1234 (AI/AQ) ............................... 309
A.6 BB 1297 battery board .............................................................................................................. 310
A.7 Specifications for the analog I/O ............................................................................................... 311
A.7.1 Specifications for the analog inputs (CPU, SM, and SB) .......................................................... 311
A.7.2 Input (AI) measurement ranges for voltage and current ........................................................... 312
A.7.3 Step response for the analog inputs (AI) .................................................................................. 313
A.7.4 Sample time and update times for the analog inputs ................................................................ 314
A.7.5 Specifications for the analog outputs ........................................................................................ 315
A.7.6 Output (AQ) measurement ranges for voltage and current ...................................................... 315
A.8 RTD and Thermocouple modules ............................................................................................. 317
A.8.1 SB 1231 RTD and SB 1231 TC specifications.......................................................................... 318
A.8.2 SM 1231 RTD specifications ..................................................................................................... 319
A.8.3 SM 1231 TC specifications ....................................................................................................... 321
A.8.4 Analog input specifications for RTD and TC (SM and SB) ....................................................... 323
A.8.5 Thermocouple type ................................................................................................................... 324
A.8.6 Thermocouple filter selection and update times ....................................................................... 325
A.8.7 RTD sensor type selection table ............................................................................................... 326
A.8.8 RTD filter selection and update times ....................................................................................... 327
A.9 Communication interfaces ......................................................................................................... 328
A.9.1 PROFIBUS master/slave .......................................................................................................... 328
A.9.1.1 CM 1242-5 PROFIBUS slave.................................................................................................... 328
A.9.1.2 CM 1243-5 PROFIBUS master ................................................................................................. 329
A.9.2 GPRS CP .................................................................................................................................. 331
A.9.2.1 Technical specifications of the CP 1242-7 GPRS .................................................................... 331
A.9.3 Teleservice (TS) ........................................................................................................................ 334
A.9.4 RS485, RS232 and RS422 communication .............................................................................. 334
A.9.4.1 CB 1241 RS485 specifications.................................................................................................. 334
A.9.4.2 CM 1241 RS422/485 specifications .......................................................................................... 337
A.9.4.3 CM 1241 RS232 specifications ................................................................................................. 338
A.10 Technology modules ................................................................................................................. 339
A.10.1 SM 1278 4xIO-Link Master SM ................................................................................................. 339
A.10.1.1 SM 1278 4xIO-Link Master signal module specifications ......................................................... 339
A.10.1.2 SM 1278 4xIO-Link Master SM wiring diagrams....................................................................... 342
A.11 Companion products ................................................................................................................. 343
A.11.1 PM 1207 power module ............................................................................................................ 343
A.11.2 CSM 1277 compact switch module ........................................................................................... 343
A.11.3 CM CANopen module ............................................................................................................... 344
Table of contents
Easy Book
Manual, 03/2014, A5E02486774-AF 13
B Exchanging a V3.0 CPU for a V4.0 CPU ............................................................................................. 345
B.1 Exchanging a V3.0 CPU for a V4.0 CPU ................................................................................... 345
Index................................................................................................................................................... 349
Table of contents
Easy Book
14 Manual, 03/2014, A5E02486774-AF
Easy Book
Manual, 03/2014, A5E02486774-AF 15
Introducing the powerful and flexible S7-1200
1
1.1
Introducing the S7-1200 PLC
The S7-1200 controller provides the flexibility and power to control a wide variety of devices
in support of your automation needs. The compact design, flexible configuration, and
powerful instruction set combine to make the S7-1200 a perfect solution for controlling a
wide variety of applications.
The CPU combines a microprocessor, an integrated power supply, input and output circuits,
built-in PROFINET, high-speed motion control I/O, and on-board analog inputs in a compact
housing to create a powerful controller. After you download your program, the CPU contains
the logic required to monitor and control the devices in your application. The CPU monitors
the inputs and changes the outputs according to the logic of your user program, which can
include Boolean logic, counting, timing, complex math operations, and communications with
other intelligent devices.
The CPU provides a PROFINET port for communication over a PROFINET network.
Additional modules are available for communicating over PROFIBUS, GPRS, RS485 or
RS232 networks.
Power connector
Memory card slot under top
door
Removable user wiring
connectors (behind the
doors)
Status LEDs for the on
-
board I/O
PROFINET connector (on
the bottom of the CPU)
Several security features help protect access to both the CPU and the control program:
Every CPU provides password protection (Page 82) that allows you to configure access
to the CPU functions.
You can use "know-how protection" (Page 84) to hide the code within a specific block.
You can use copy protection (Page 85) to bind your program to a specific memory card or
CPU.
Introducing the powerful and flexible S7-1200
1.1 Introducing the S7-1200 PLC
Easy Book
16 Manual, 03/2014, A5E02486774-AF
Table 1- 1 Comparing the CPU models
Feature
CPU 1211C
CPU 1212C
CPU 1214C
CPU 1215C
CPU 1217C
Physical size (mm)
90 x 100 x 75
90 x 100 x 75
110 x 100 x 75
130 x 100 x 75
150 x 100 x 75
User memory
Work
30 Kbytes
50 Kbytes
75 Kbytes
100 Kbytes
125 Kbytes
Load
1 Mbyte
1 Mbyte
4 Mbytes
4 Mbytes
4 Mbytes
Retentive
10 Kbytes
10 Kbytes
10 Kbytes
10 Kbytes
10 Kbytes
Local on-board
I/O
Digital 6 inputs/4
outputs
8 inputs/6
outputs
14 inputs/10
outputs
14 inputs/10
outputs
14 inputs/10
outputs
Analog 2 inputs 2 inputs 2 inputs 2 inputs/2
outputs
2 inputs/2
outputs
Process image
size
Inputs (I)
1024 bytes
1024 bytes
1024 bytes
1024 bytes
1024 bytes
Outputs (Q)
1024 bytes
1024 bytes
1024 bytes
1024 bytes
1024 bytes
Bit memory (M)
4096 bytes
4096 bytes
8192 bytes
8192 bytes
8192 bytes
Signal module (SM) expansion
None
2
8
8
8
Signal board (SB), Battery board
(BB), or communication board
(CB)
1 1 1 1 1
Communication module (CM)
(left-side expansion)
3 3 3 3 3
High-speed
counters
Total
Up to 6 configured to use any built-in or SB inputs
1 MHz
--
--
--
--
Ib.2 to Ib.5
100/
1
80 kHz
Ia.0 to Ia.5
Ia.0 to Ia.5
Ia.0 to Ia.5
Ia.0 to Ia.5
Ia.0 to Ia.5
30/
1
20 kHz
--
Ia.6 to Ia.7
Ia.6 to Ib.5
Ia.6 to Ib.5
Ia.6 to Ib.1
Pulse outputs2
Total
Up to 4 configured to use any built-in or SB outputs
1 MHz
--
--
--
--
Qa.0 to Qa.3
100 kHz
Qa.0 to Qa.3
Qa.0 to Qa.3
Qa.0 to Qa.3
Qa.0 to Qa.3
Qa.4 to Qb.1
20 kHz
--
Qa.4 to Qa.5
Qa.4 to Qb.1
Qa.4 to Qb.1
--
Memory card
SIMATIC Memory card (optional)
Real time clock retention time
20 days, typ./12 day min. at 40 degrees C (maintenance-free Super Capacitor)
PROFINET
Ethernet communication port
1 1 1 2 2
Real math execution speed
2.3 μs/instruction
Boolean execution speed
0.08 μs/instruction
1
The slower speed is applicable when the HSC is configured for quadrature mode of operation.
2 For CPU models with relay outputs, you must install a digital signal (SB) to use the pulse outputs.
The different CPU models provide a diversity of features and capabilities that help you create
effective solutions for your varied applications. For detailed information about a specific
CPU, see the technical specifications (Page 281).
Introducing the powerful and flexible S7-1200
1.1 Introducing the S7-1200 PLC
Easy Book
Manual, 03/2014, A5E02486774-AF 17
Table 1- 2 Blocks, timers, and counters supported by S7-1200
Element
Description
Blocks
Type
OB, FB, FC, DB
Size 30 Kbytes (CPU 1211C)
50 Kbytes (CPU 1212C)
64 Kbytes (CPU 1214C, CPU 1215C, and CPU 1217C)
Quantity
Up to 1024 blocks total (OBs + FBs + FCs + DBs)
Nesting depth 16 from the program cycle or startup OB;
6 from any interrupt event OB
Monitoring
Status of 2 code blocks can be monitored simultaneously
OBs
Program cycle
Multiple
Startup
Multiple
Time-delay interrupts
4 (1 per event)
Cyclic interrupts
4 (1 per event)
Hardware interrupts
50 (1 per event)
Time error interrupts
1
Diagnostic error interrupts
1
Pull or plug of modules
1
Rack or station failure
1
Time of day
Multiple
Status
1
Update
1
Profile
1
Timers
Type
IEC
Quantity
Limited only by memory size
Storage
Structure in DB, 16 bytes per timer
Counters
Type
IEC
Quantity
Limited only by memory size
Storage Structure in DB, size dependent upon count type
SInt, USInt: 3 bytes
Int, UInt: 6 bytes
DInt, UDInt: 12 bytes
Introducing the powerful and flexible S7-1200
1.2 Expansion capability of the CPU
Easy Book
18 Manual, 03/2014, A5E02486774-AF
1.2
Expansion capability of the CPU
The S7-1200 family provides a variety of modules and plug-in boards for expanding the
capabilities of the CPU with additional I/O or other communication protocols. For detailed
information about a specific module, see the technical specifications (Page 281).
Communication module (CM or communication processor (CP)
CPU
Signal board (SB), communication board (CB), or Battery Board (BB)
Signal module (SM)
Table 1- 3 Digital signal modules and signal boards
Type
Input only
Output only
Combination In/Out
digital SB 4 x 24 VDC In,
200 kHz
4 x 5 VDC In,
200 kHz
4 x 24 VDC Out, 200 kH
z
4 x 5 VDC Out,
200 kHz
2 x 24 VDC In/2 x 24 VDC Out
2 x 24 VDC In/2 x 24 VDC Out,
200 kHz
2 x 5 VDC In/2 x 5 VDC Out,
200 kHz
digital SM 8 x 24 VDC In 8 x 24 VDC Out
8 x Relay Out
8 x Relay Out
(Changeover)
8 x 24 VDC In/8 x 24 VDC Out
8 x 24 VDC In/8 x Relay Out
8 x 120/230 VAC In/8 x Relay Out
16 x 24 VDC In 16 x 24 VDC Out
16 x Relay Out
16 x 24 VDC In/16 x 24 VDC Out
16 x 24 VDC In/16 x Relay Out
Introducing the powerful and flexible S7-1200
1.2 Expansion capability of the CPU
Easy Book
Manual, 03/2014, A5E02486774-AF 19
Table 1- 4 Analog signal modules and signal boards
Type
Input only
Output only
Combination In/Out
analog SB 1 x 12 bit Analog In
1 x 16 bit RTD
1 x 16 bit Thermocouple
1 x Analog Out -
analog SM 4 x Analog In
4 x Analog In x 16 bit
8 x Analog In
Thermocouple:
4 x 16 bit TC
8 x 16 bit TC
RTD:
4 x 16 bit RTD
8 x 16 bit RTD
2 x Analog Out
4 x Analog Out
4 x Analog In/2 x Analog Out
Table 1- 5 Communication interfaces
Module
Type
Description
Communication module (CM)
RS232
Full-duplex
RS422/485 Full-duplex (RS422)
Half-duplex (RS485)
PROFIBUS Master
DPV1
PROFIBUS Slave
DPV1
AS-i Master (CM 1243-2)
AS-Interface
Communication processor (CP) Modem connectivity GPRS
Communication board (CB) RS485 Half-duplex
TeleService1
TS Adapter IE Basic
Connection to CPU
TS Adapter GSM
GSM/GPRS
TS Adapter Modem
Modem
TS Adapter ISDN
ISDN
TS Adapter RS232 RS232
1
The TS Adapter IE Basic allows you to connect various communication interfaces to the PROFINET port of the CPU
using an Ethernet cable. You can install up to 3 TS adapter modules onto the TS Adapter IE Basic.
Introducing the powerful and flexible S7-1200
1.2 Expansion capability of the CPU
Easy Book
20 Manual, 03/2014, A5E02486774-AF
Table 1- 6 Technology modules
Module
Type
Description
IO Link SM 1278 4xIO-Link Master Supports 4 IO link slaves
Table 1- 7 Other boards
Module
Description
Battery board Plugs into expansion board interface on front of CPU. Provides long term
backup of realtime clock
Introducing the powerful and flexible S7-1200
1.3 S7-1200 modules
Easy Book
Manual, 03/2014, A5E02486774-AF 21
1.3
S7-1200 modules
Table 1- 8 S7-1200 expansion modules
Type of module
Description
The CPU supports one plug-in
expansion board:
A signal board (SB) provides
additional I/O for your CPU.
The SB connects on the front of
the CPU.
A communication board (CB)
allows you to add another
communication port to your
CPU.
A battery board (BB) allows you
to provide long term backup of
the realtime clock.
Status LEDs on
the SB
Removable user
wiring connector
Signal modules (SMs) add
additional functionality to the CPU.
SMs connect to the right side of the
CPU.
Digital I/O
Analog I/O
RTD and thermocouple
SM 1278 IO-Link Master
Status LEDs
Bus connector
slide tab
Removable user
wiring connector
Communication modules (CMs)
and communications processors
(CPs) add communication options
to the CPU, such as for
PROFIBUS or RS232/RS485
connectivity (for PtP, Modbus or
USS), or the AS-i master. A CP
prov
ides capabilities for other types
of communication, such as to
connect the CPU over a GPRS
network.
The CPU supports up to 3 CMs
or CPs
Each CM or CP connects to the
left side of the CPU (or to the
left side of another CM or CP)
Status LEDs
Communication
connector
Introducing the powerful and flexible S7-1200
1.4 Basic HMI panels
Easy Book
22 Manual, 03/2014, A5E02486774-AF
1.4
Basic HMI panels
The SIMATIC HMI Basic Panels provide touch-screen devices for basic operator control and
monitoring tasks. All panels have a protection rating for IP65 and have CE, UL, cULus, and
NEMA 4x certification.
Basic HMI Panel
Description
Technical data
KP 300 Basic PN
3.6" membrane keyboard with 10 freely
configurable tactile keys
Mono (STN, black/white)
87 mm x 31 mm (3.6")
Backlight color programmed (white,
green, yellow, or red)
Resolution: 240 x 80
250 tags
50 process screens
200 alarms
25 curves
40 KB recipe memory
5 recipes, 20 data records, 20 entries
KTP 400 Basic PN
4" touch screen with 4 tactile keys
Mono (STN, gray scale)
76.79 mm x 57.59 mm (3.8")
Portrait or landscape
Resolution: 320 x 240
250 tags
50 process screens
200 alarms
25 curves
40 KB recipe memory
5 recipes, 20 data records, 20 entries
KTP 600 Basic PN
6" touch screen with 6 tactile keys
Color (TFT, 256 colors) or Mono
(STN, gray scales)
115.2 mm x 86.4 mm (5.7")
Portrait or landscape
Resolution: 320 x 240
500 tags
50 process screens
200 alarms
25 curves
40 KB recipe memory
5 recipes, 20 data records, 20 entries
KTP 1000 Basic PN
10" touch screen with 8 tactile keys
Color (TFT, 256 colors)
211.2 mm x 158.4 mm (10.4")
Resolution: 640 x 480
500 tags
50 process screens
200 alarms
25 curves
40 KB recipe memory
5 recipes, 20 data records, 20 entries
TP 1500 Basic PN
15" touch screen
Color (TFT, 256 colors)
304.1 mm x 228.1 mm (15.1")
Resolution: 1024 x 768
500 tags
50 process screens
200 alarms
25 curves
40 KB recipe memory (integrated
flash)
5 recipes, 20 data records, 20 entries
Introducing the powerful and flexible S7-1200
1.5 Mounting dimensions and clearance requirements
Easy Book
Manual, 03/2014, A5E02486774-AF 23
1.5
Mounting dimensions and clearance requirements
The S7-1200 PLC is designed to be easy to install. Whether mounted on a panel or on a
standard DIN rail, the compact size makes efficient use of space.
Refer to the
S7-1200 System Manual
for specific requirements and guidelines for installation.
Introducing the powerful and flexible S7-1200
1.5 Mounting dimensions and clearance requirements
Easy Book
24 Manual, 03/2014, A5E02486774-AF
Table 1- 9 Mounting dimensions (mm)
S7-1200 Devices
Width A (mm)
Width B (mm)
Width C (mm)
CPU
CPU 1211C and CPU 1212C
90
45
--
CPU 1214C
110
55
--
CPU 1215C 130 65 (top) Bottom:
C1: 32.5
C2: 65
C3: 32.5
CPU 1217C 150 75 Bottom:
C1: 37.5
C2: 75
C3: 37.5
Signal modules Digital 8 and 16 point
Analog 2, 4, and 8 point
Thermocouple 4 and 8 point
RTD 4 point
SM 1278 IO Link-Master
45 22.5 --
Digital DQ 8 x Relay (Changeover)
70
35
--
Analog 16 point
RTD 8 point
70 35 --
Communication
interfaces
CM 1241 RS232, and
CM 1241 RS422/485
CM 1243-5 PROFIBUS master and
CM 1242-5 PROFIBUS slave
CM 1242-2 AS-i Master
CP 1242-7 GPRS
30 15 --
TS (Teleservice) Adapter IE Basic1
TS Adapter
TS Module
30
30
15
15
--
--
1
Before installing the TS (Teleservice) Adapter IE Basic, you must first connect the TS Adapter and a TS module. The
total width ("width A") is 60 mm.
Each CPU, SM, CM, and CP supports mounting on either a DIN rail or on a panel. Use the
DIN rail clips on the module to secure the device on the rail. These clips also snap into an
extended position to provide screw mounting positions to mount the unit directly on a panel.
The interior dimension of the hole for the DIN clips on the device is 4.3 mm.
A 25 mm thermal zone must be provided above and below the unit for free air circulation.
Introducing the powerful and flexible S7-1200
1.5 Mounting dimensions and clearance requirements
Easy Book
Manual, 03/2014, A5E02486774-AF 25
The S7-1200 equipment is designed to be easy to install. You can install an S7-1200 either
on a panel or on a standard rail, and you can orient the S7-1200 either horizontally or
vertically. The small size of the S7-1200 allows you to make efficient use of space.
WARNING
Installation requirements for S7-1200 PLCs
The SIMATIC S7-1200 PLCs are Open Type Controllers. It is required that you install the
S7-1200 in a housing, cabinet, or electric control room. Entry to the housing, cabinet, or
electric control room should be limited to authorized personnel.
Failure to follow these installation requirements could result in death, severe personal injury
and/or property damage.
Always follow these requirements when installing S7-1200 PLCs.
Separate the S7-1200 devices from heat, high voltage, and electrical noise
As a general rule for laying out the devices of your system, always separate the devices that
generate high voltage and high electrical noise from the low-voltage, logic-type devices such
as the S7-1200.
When configuring the layout of the S7-1200 inside your panel, consider the heat-generating
devices and locate the electronic-type devices in the cooler areas of your cabinet. Reducing
the exposure to a high-temperature environment will extend the operating life of any
electronic device.
Consider also the routing of the wiring for the devices in the panel. Avoid placing low-voltage
signal wires and communications cables in the same tray with AC power wiring and high-
energy, rapidly-switched DC wiring.
Provide adequate clearance for cooling and wiring
S7-1200 devices are designed for natural convection cooling. For proper cooling, you must
provide a clearance of at least 25 mm above and below the devices. Also, allow at least 25
mm of depth between the front of the modules and the inside of the enclosure.
CAUTION
For vertical mounting, the maximum allowable ambient temperature is reduced by 10
degrees C.
Orient a vertically mounted S7-1200 system as shown in the following figure.
Ensure that the S7-1200 system is mounted correctly.
When planning your layout for the S7-1200 system, allow enough clearance for the wiring
and communications cable connections.
Introducing the powerful and flexible S7-1200
1.5 Mounting dimensions and clearance requirements
Easy Book
26 Manual, 03/2014, A5E02486774-AF
Side view
Vertical installation
Horizontal installation
Clearance area
WARNING
Installation or removal of S7-1200 or related equipment with the power applied could cause
electric shock or unexpected operation of equipment.
Failure to disable all power to the S7-1200 and related equipment during installation or
removal procedures could result in death, severe personal injury and/or property damage
due to electric shock or unexpected equipment operation.
Always follow appropriate safety precautions and ensure that power to the S7-1200 is
disabled before attempting to install or remove S7-1200 CPUs or related equipment.
Always ensure that whenever you replace or install an S7-1200 device you use the correct
module or equivalent device.
WARNING
Correct installation of S7-1200 modules
Incorrect installation of an S7-1200 module can cause the program in the S7-1200 to
function unpredictably.
Failure to replace an S7-1200 device with the same model, orientation, or order could result
in death, severe personal injury and/or property damage due to unexpected equipment
operation.
Replace an S7-1200 device with the same model, and be sure to orient and position it
correctly.
Introducing the powerful and flexible S7-1200
1.6 New features
Easy Book
Manual, 03/2014, A5E02486774-AF 27
1.6
New features
The following features are new in this release:
The S7-1200 supports new Organization Blocks (OBs) (Page 89) with differences in
priority levels and interrupts.
The Web server (Page 193) now supports the display of standard Web pages and user-
defined Web pages from a mobile device as well as from a PC. The standard Web pages
are available in English, German, French, Spanish, Italian, and Simplified Chinese with
this release.
The "Download in Run" (Page 272) feature now supports a maximum of twenty blocks
that you can download in RUN mode. You can also add tags and modify tags in existing
data blocks and function blocks and download the modified data blocks in RUN mode.
The online and diagnostic tools of STEP 7 provide the means to perform a firmware
update (Page 269) of your CPU, signal modules, communication modules, and attached
signal or communication board.
STEP 7 includes a trace and logic analyzer function (Page 274) that you can use with the
V4.0 S7-1200 CPUs. With this feature, you can configure specific data that you want to
trace and record when the CPU meets a trigger condition that you define. The CPU
stores the recorded data, and STEP 7 provides tools for retrieving and analyzing the
recorded data.
New programming instructions:
Set tag on signal edge:
R_TRIG, F_TRIG
Write local time:
WR_LOC_T
String maximum length:
MAX_LEN
Time of day interrupts:
SET_TINTL, CAN_TINT, ACT_TINT, QRY_TINT
Process recipes:
RecipeExport, RecipeImport
Address handling:
LOG2GEO, RD_ADDR
Motion control:
MC_WriteParam, MC_ReadParam
Enable / disable password
: ENDIS_PW
HSC improvements to allow any HSC instruction input or output to be assigned to any
built-in or SB digital input
PTO/PWM improvements to allow any PTO/PWM instruction input or output to be
assigned to any built-in or SB digital output
Enhanced library features, including versioning
Introducing the powerful and flexible S7-1200
1.6 New features
Easy Book
28 Manual, 03/2014, A5E02486774-AF
New modules for the S7-1200
New modules expand the power of the S7-1200 CPU and provide the flexibility to meet your
automation needs:
New CPU 1217C DC/DC/DC with high-speed differential points
New and improved S7-1200 signal modules. The new signal modules (6ES7 2xx-xxx32-
0XB0) replace existing signal modules (6ES7 2xx-xxx30-0XB0). The new modules
provide:
4-20 mA range added to analog input and output modules
Wirebreak detection when using 4-20 mA added to analog input modules
Connector keying to prevent errors when plugging in field wiring connectors added to
modules with relay outputs
Spare parts compatibility: you can employ the revised module in place of existing
modules without any changes.
New spare parts available for use with S7-1200 CPUs
New CPU 1217C Input Simulator (6ES7 274-1XK30-0XA0)
New SM 1278 4xIO-Link Master (6ES7 278-4BD32-0XB0) functions as both a signal
module and a communication module, and allows connection of up to 4 IO-Link slaves (3-
wire connection) or 4 standard actuators or standard encoders
New S7-1200 Potentiometer module (6ES7 274-1XA30-0XA0)
New CM CANopen for S7-1200 is a plug-in module that allows you to connect CANopen
devices to the S7-1200 PLC. It can be configured to be both master or slave.
Exchanging your V3.0 CPU for a V4.0 CPU
If you are replacing an S7-1200 V3.0 CPU with an S7-1200 V4.0 CPU, take note of the
documented differences in the versions.
See also
Basic HMI panels (Page 22)
Easy Book
Manual, 03/2014, A5E02486774-AF 29
STEP 7 makes the work easy
2
STEP 7 provides a user-friendly environment to develop controller logic, configure HMI
visualization, and setup network communication. To help increase your productivity, STEP 7
provides two different views of the project: a task-oriented set of portals that are organized
on the functionality of the tools (Portal view), or a project-oriented view of the elements within
the project (Project view). Choose which view helps you work most efficiently. With a single
click, you can toggle between the Portal view and the Project view.
Portal view
Portals for the different tasks
Tasks for the selected portal
Selection panel for the selected
action
Changes to the Project view
Project view
Menus and toolbar
Project navigator
Work area
Task cards
Inspector window
Changes to the Portal view
Editor bar
With all of these components in one place, you have easy access to every aspect of your
project. For example, the inspector window shows the properties and information for the
object that you have selected in the work area. As you select different objects, the inspector
window displays the properties that you can configure. The inspector window includes tabs
that allow you to see diagnostic information and other messages.
By showing all of the editors that are open, the editor bar helps you work more quickly and
efficiently. To toggle between the open editors, simply click the different editor. You can also
arrange two editors to appear together, arranged either vertically or horizontally. This feature
allows you to drag and drop between editors.
STEP 7 makes the work easy
2.1 Easy to insert instructions into your user program
Easy Book
30 Manual, 03/2014, A5E02486774-AF
2.1
Easy to insert instructions into your user program
STEP 7 provides task cards that
contain the instructions for your
program. The instructions are grouped according to function.
To create your program, you drag instructions from the task card
onto a network.
2.2
Easy access to your favorite instructions from a toolbar
STEP 7 provides a "Favorites" toolbar to give you quick access t
o the instructions that you
frequently use. Simply click the icon for the instruction to insert it into your network!
(For the "Favorites" in the instruction tree, double
-
click the icon.)
You can easily customize the
"Favorites" by adding new
instructions.
Simply drag and drop an
instruction to the "Favorites".
The instruction is now just a click
away
!
STEP 7 makes the work easy
2.3 Easy to add inputs or outputs to LAD and FBD instructions
Easy Book
Manual, 03/2014, A5E02486774-AF 31
2.3
Easy to add inputs or outputs to LAD and FBD instructions
Some of the instructions allow you to create additional inputs or outputs.
To add an input or output, click the "Create" icon or right-click on an input stub for one of
the existing IN or OUT parameters and select the "Insert input" command.
To remove an input or output, right-click on the stub for one of the existing IN or OUT
parameters (when there are more than the original two inputs) and select the "Delete"
command.
2.4
Expandable instructions
Some of the more complex instructions are expandable, displaying only the key inputs and
outputs. To display all the inputs and outputs, click the arrow at the bottom of the instruction.
STEP 7 makes the work easy
2.5 Easy to change the operating mode of the CPU
Easy Book
32 Manual, 03/2014, A5E02486774-AF
2.5
Easy to change the operating mode of the CPU
The CPU does not have a physical switch for changing the operating mode (STOP or RUN).
Use the "Start CPU" and "Stop CPU" toolbar buttons to change the operating
mode of the CPU.
When you configure the CPU in the device configuration, you configure the start-up behavior
in the properties of the CPU (Page 76).
The "Online and diagnostics" portal also provides an operator panel for changing the
operating mode of the online CPU. To use the CPU operator panel, you must be connected
online to the CPU. The "Online tools" task card displays an operator panel that shows the
operating mode of the online CPU. The operator panel also allows you to change the
operating mode of the online CPU.
Use the button on the operator panel to change the op
erating mode
(STOP or RUN). The operator panel also provides an MRES button for
resetting the memory.
The color of the RUN/STOP indicator shows the current operating mode of the CPU. Yellow
indicates STOP mode, and green indicates RUN mode.
Refer to Operating Modes of the CPU in the S7-1200 System Manual for configuring the
default operating mode on power up.
STEP 7 makes the work easy
2.6 Easy to modify the appearance and configuration of STEP 7
Easy Book
Manual, 03/2014, A5E02486774-AF 33
2.6
Easy to modify the appearance and configuration of STEP 7
You can select a variety of settings,
such as the appearance of the
interface, language, or the folder for
saving your work.
Select the "Se
ttings" command from
the "Options" menu to change these
settings.
2.7
Project and global libraries for easy access
The global and project libraries allow you to reuse the stored objects throughout a project or
across projects. For example, you can create block templates for use in different projects
and adapt them to the particular requirements of your automation task. You can store a
variety of objects in the libraries, such as FCs, FBs, DBs, device configuration, data types,
watch tables, process screens, and faceplates. You can also save the components of the
HMI devices in your project.
Each project has a project library for storing the o
bjects to be
used more than once within the project. This project library is
part of the project. Opening or closing the project opens or
closes the project library, and saving the project saves any
changes in the project library.
You can create your own global library to store the objects you want to make available for
other projects to use. When you create a new global library, you save this library to a
location on your computer or network.
STEP 7 makes the work easy
2.8 Easy to select a version of an instruction
Easy Book
34 Manual, 03/2014, A5E02486774-AF
2.8
Easy to select a version of an instruction
The development and release cycles for certain sets of instructions (such as Modbus, PID
and motion) have created multiple released versions for these instructions. To help ensure
compatibility and migration with older projects, STEP 7 allows you to choose which version
of instruction to insert into your user program.
Click the icon on the instruction tree task card to enable the
headers and columns of the instruction tree.
To change the version of the instruction, select the
appropriate version from the drop
-down list.
2.9
Easy to drag and drop between editors
To help you perform tasks quickly and easily,
STEP
7 allows you to drag and drop elements
from one editor to another. For example, you
can drag an input from
the CPU to the address
of an instruction in your user program.
You must zoom in at least 200% to select the
inputs or outputs of the CPU.
Notice that the tag names are displayed not
only in the PLC tag table, but also are
dis
played on the CPU.
To display two editors at one time, use the
"Split editor" menu commands or buttons in
the toolbar.
STEP 7 makes the work easy
2.10 Changing the call type for a DB
Easy Book
Manual, 03/2014, A5E02486774-AF 35
To toggle between the editors that have been opened, click the icons in the editor bar.
2.10
Changing the call type for a DB
STEP
7 allows you to easily create or change the
association of a DB for an instruction or an FB that is in
an FB.
You can switch the association between different DBs.
You can switch the association between a single-
instance DB and a multi-instance DB.
You can create an instance DB (if an instance DB is
missing or not available).
You can access the "Change call type" command either
by right
-clicking the instruction or FB in the program
editor or by selecting the "Block call" command from the
"Options" menu.
The "Call options" dialog allows
you to select a single
-instance
or multi
-instance DB. You can
also select specific DBs from a
drop
-down list of available DBs.
STEP 7 makes the work easy
2.11 Temporarily disconnecting devices from a network
Easy Book
36 Manual, 03/2014, A5E02486774-AF
2.11
Temporarily disconnecting devices from a network
You can disconnect individual network devices from the subnet. Because the configuration of
the device is not removed from the project, you can easily restore the connection to the
device.
Right
-click the interface port of the network
devi
ce and select the "Disconnect from
subnet" command from the context menu.
STEP 7 reconfigures the network connections, but does not remove the disconnected device
from the project. While the network connection is deleted, the interface addresses are not
changed.
When you download the new network connections, the CPU must be set to STOP mode.
To reconnect the device, simply create a new network connection to the port of the device.
STEP 7 makes the work easy
2.12 Easy to virtually "unplug" modules without losing the configuration
Easy Book
Manual, 03/2014, A5E02486774-AF 37
2.12
Easy to virtually "unplug" modules without losing the configuration
STEP 7 provides a stora
ge area for
"unplugged" modules. You can drag a
module from the rack to save the
configuration of that module. These
unplugged modules are saved with your
project, allowing you to reinsert the
module in the future without having to
reconfigure the paramete
rs.
One use of this feature is for temporary
maintenance. Consider a scenario where
you might b
e waiting for a replacement
module and plan to temporarily use a
different module as a short
-term
replacement. You could drag the
configured module from the rack to the
"Unplugged modules" and then insert the
temporary module.
STEP 7 makes the work easy
2.12 Easy to virtually "unplug" modules without losing the configuration
Easy Book
38 Manual, 03/2014, A5E02486774-AF
Easy Book
Manual, 03/2014, A5E02486774-AF 39
Getting started
3
3.1
Create a project
Working with STEP 7 is easy! See how quickly you can get started with creating a project.
In the Start portal, click the
"Create new project" task.
Enter a project name and click
the "Create" button.
After creating the project, select the Devices &
Networks portal.
Click the "Add new device" task.
Select the CPU to add to the project:
1.
In the "Add new device" dialog, click the
"SIMATIC PLC" button.
2.
Select a CPU from the list.
3.
To add the selected CPU to the project, click
the "Add" button.
Note that the "Open device view" option is
selected. Clicki
ng "Add" with this option selected
opens the "Device configuration" of the Project
view.
The Device view displays the
CPU that you adde
d.
Getting started
3.2 Create tags for the I/O of the CPU
Easy Book
40 Manual, 03/2014, A5E02486774-AF
3.2
Create tags for the I/O of the CPU
"PLC tags" are the symbolic names for I/O and addresses. After you create a PLC tag,
STEP 7 stores the tag in a tag table. All of the editors in your project (such as the program
editor, the device editor, the visualization editor, and the watch table editor) can access the
tag table.
With the device editor open, open a tag table.
You can see the open editors displayed in the edito
r bar.
In the
tool bar, click the "Split editor space horizontally" button.
STEP
7 displays both the tag table and the
device editor together.
Zoom the device configuration to over 200% so that the I/O points of the CPU are legible and
selectable. Drag the inputs and outputs from the CPU to the tag table:
1. Select I0.0 and drag it to the first row of the tag table.
2. Change the tag name from "I0.0" to "Start".
3. Drag I0.1 to the tag table and change the name to "Stop".
4. Drag Q0.0 (on the bottom of the CPU) to the tag table and change the name to
"Running".
Getting started
3.3 Create a simple network in your user program
Easy Book
Manual, 03/2014, A5E02486774-AF 41
With the tags entered into the PLC tag table, the tags are available to your user program.
3.3
Create a simple network in your user program
Your program code consists of instructions that the CPU executes in sequence. For this
example, use ladder logic (LAD) to create the program code. The LAD program is a
sequence of networks that resemble the rungs of a ladder.
To open the program editor, follow these steps:
1.
Expand the "Program blocks" folder in the Project tree to
display the "Main [OB1]" block.
2.
Double-click the "Main [OB1]" block.
The program edi
tor opens the program block (OB1).
Use the buttons on the "Favorites" to insert contacts and coils onto the network.
Getting started
3.3 Create a simple network in your user program
Easy Book
42 Manual, 03/2014, A5E02486774-AF
1.
Click the "Normally open contact"
button on the "Favorites" to add a
contact to the network.
2.
For this example, add a second
contact.
3.
Click the "Output coil" button to
insert a coil.
The "Favorites" also provides a button for creating a branch
1.
Select the left rail to select the rail
for the branch.
2.
Click the "Open branch" icon to
add a branch to the rail of the
network.
3.
Insert another normally open
contact to the open branch.
4.
Drag the double-
headed arrow to a
connection point (the green square
on the rung) between the two
contacts on the first rung.
To save the project, click the "Save project" button in the toolbar. Notice that you do not have
to finish editing the rung before saving. You can now associate the tag names with these
instructions.
Getting started
3.4 Use the PLC tags in the tag table for addressing the instructions
Easy Book
Manual, 03/2014, A5E02486774-AF 43
3.4
Use the PLC tags in the tag table for addressing the instructions
Using the tag table, you can quickly enter the PLC tags for the addresses of the contacts and
coils.
1.
Double-click the default address
<
??.?>
above the first normally
open contact.
2.
Click the selector icon to the right
of the address to open the tags in
the tag table.
3.
From the drop-down list, select
"Start" for the first contact.
4.
For the second contact, repeat the
preceding steps and select the tag
"Stop".
5.
For the coil and the latching
contact, select the tag "Running".
You can also drag the I/O addresses directly
from the CPU. Simply
split the work area of the
Project view
(Page 34).
You must zoom the CPU to over 200% in order
to select the I/O points.
You can drag the I/O on the CPU in the "Device
configuration" to the LAD instruction in the
program editor to create not only the address for
the instruction, but also to create a
n entry in the
PLC tag table.
Getting started
3.5 Add a "box" instruction
Easy Book
44 Manual, 03/2014, A5E02486774-AF
3.5
Add a "box" instruction
The program editor features a generic "box" instruction. After inserting this box instruction,
you then select the type of instruction, such as an ADD instruction, from a drop-down list.
Click the generic "box" instruction in
the "Favorites" tool ba
r.
The generic "box" instruction supports
a variety of instructions.
For this
example, create an ADD instruction:
1.
Click the yellow corner of the box
instruction to display the drop-
down list of instructions.
2.
Scroll down the list and select the
ADD instruction.
3.
Click the yellow corner by the "?" to
select the data type for the inputs
and output.
You can now enter the tags (or
memory addresses) for the values to
use with the ADD instruction.
You can also create additional inputs for certain instructions:
1.
Click one of the inputs inside the box.
2.
Right-click to display the context menu and select the "Insert
input" command.
The ADD instruction now uses three inputs.
Getting started
3.6 Use the CALCULATE instruction for a complex mathematical equation
Easy Book
Manual, 03/2014, A5E02486774-AF 45
3.6
Use the CALCULATE instruction for a complex mathematical
equation
The Calculate instruction lets you create a math function that op
erates on multiple input
parameters to produce the result, according to the equation that you define.
In the Basic instruction tree, expand the Math functions folder.
Double
-click the Calculate instruction to insert the instruction
into your user program.
The unconfigured Calculate
instruction provides two input
parameters and an output
parameter.
Click the "???" and select the data types for the input and output
parameters. (The input and output parameters must all be the same
data type.)
For this example, select the "Real" data type.
Click the "Edit equation" icon to enter the equation.
For this example, enter the following equation for scaling a raw analog value. (The "In" and
"Out" designations correspond to the parameters of the Calculate instruction.)
Out value
= ((Out high - Out low) / (In high - In low)) * (In value - In low) + Out low
Out
= ((in4 - in5) / (in2 - in3)) * (in1 - in3) + in5
Getting started
3.6 Use the CALCULATE instruction for a complex mathematical equation
Easy Book
46 Manual, 03/2014, A5E02486774-AF
Where:
Out
value
(Out)
Scaled output value
In value
(in1)
Analog input value
In
high
(in2)
Upper limit for the scaled input value
In
low
(in3)
Lower limit for the scaled input value
Out
high
(in4)
Upper limit for the scaled output value
Out
low
(in5)
Lower limit for the scaled output value
In the "Edit Calculate" box, enter the equation with the parameter names:
OUT = ((in4 - in5) / (in2 - in3)) * (in1 - in3) + in5
When you click "OK", the Calculate
instruction creates the inputs
required for the instruction.
Enter the tag n
ames for the values
that correspond to the parameters.
Getting started
3.7 Add an HMI device to the project
Easy Book
Manual, 03/2014, A5E02486774-AF 47
3.7
Add an HMI device to the project
Adding an HMI device to your project is
easy!
1.
Double-click the "Add new device" icon.
2.
Click the "SIMATIC HMI" button in the
Add new device" dialog.
3.
Select the specific HMI device from the
list.
You can choose to run the HMI wizard
to help you configure the screens for
the HMI device.
4.
Click "OK" to add the HMI device to
your project.
The TIA
Portal adds the HMI device to the project.
The TIA
Portal provides an HMI wizard that helps you
configure all of the screens and structure for your HMI
device.
If you do not run the HMI wizard, the TIA Portal creates a simple default HMI screen. You
can add additional screens or objects on screens later.
Getting started
3.8 Create a network connection between the CPU and HMI device
Easy Book
48 Manual, 03/2014, A5E02486774-AF
3.8
Create a network connection between the CPU and HMI device
Creati
ng a network is easy!
Go to "Devices and Networks" and select the
Network view to display the CPU and HMI
device.
To create a PROFINET network, drag a line
from the green box (Ethernet port) on one
device to the green box on the other device.
A network co
nnection is created for the two
devices.
3.9
Create an HMI connection to share tags
By creating an HMI connection between the
two devi
ces, you can easily share the tags
between the two devices.
With the network connection selected, click
the "Connections" button and select "HMI
connection" from the drop-down list.
The HMI connection turns the two devices
blue.
Select the CPU device and drag the line to
the HMI device.
The HMI connection allows you to configure
the HMI tags by selecting a list of PLC tags.
Getting started
3.10 Create an HMI screen
Easy Book
Manual, 03/2014, A5E02486774-AF 49
You can use other options for creating an HMI connection:
Dragging a PLC tag from the PLC tag table, the program editor or the device
configuration editor to the HMI screen editor automatically creates an HMI connection.
Using the HMI wizard to browse for the PLC automatically creates the HMI connection.
3.10
Create an HMI screen
Even if you do not utilize the HMI wizard, configuring an HMI screen is easy.
STEP 7 provide
s a standard set of
libraries for inserting basic shapes,
interactive elements, and even standard
graphics.
To add an element, simply drag and drop one of the elements onto the screen. Use the
properties for the element (in the Inspector window) to configure the appearance and
behavior of the element.
You can also create elements on your screen by dragging and dropping PLC tags either
from the Project tree or the program editor to the HMI screen. The PLC tag becomes an
element on the screen. You can then use the properties to change the parameters for this
element.
Getting started
3.11 Select a PLC tag for the HMI element
Easy Book
50 Manual, 03/2014, A5E02486774-AF
3.11
Select a PLC tag for the HMI element
After you create the element on your screen, use the properties of the element to assign a
PLC tag to the element. Click the selector button by the tag field to display the PLC tags of
the CPU.
You can also drag and drop PLC tags from the Project tree to the HMI screen. Display the
PLC tags in the "Details" view of the project tree and then drag the tag to the HMI screen.
Easy Book
Manual, 03/2014, A5E02486774-AF 51
PLC concepts made easy
4
4.1
Tasks performed every scan cycle
Each scan cycle includes writing the outputs, reading the inputs, executing the user program
instructions, and performing system maintenance or background processing.
The cycle is referred to as a scan cycle or sca
n. Under
default conditions, all digital and analog I/O points are
updated synchronously with the scan cycle using an
internal memory area called the process image. The
process image contains a snapshot of the physical inputs
and outputs on the CPU, signal
board, and signal
modules.
The CPU reads the physical inputs just prior to the execution of the user program and
stores the input values in the process image input area. This ensures that these values
remain consistent throughout the execution of the user instructions.
The CPU executes the logic of the user instructions and updates the output values in the
process image output area instead of writing to the actual physical outputs.
After executing the user program, the CPU writes the resulting outputs from the process
image output area to the physical outputs.
This process provides consistent logic through the execution of the user instructions for a
given cycle and prevents the flickering of physical output points that might change state
multiple times in the process image output area.
PLC concepts made easy
4.2 Operating modes of the CPU
Easy Book
52 Manual, 03/2014, A5E02486774-AF
STARTUP
RUN
A
Clears the input (or "I") memory
Writes Q memory to the physical outputs
B Initializes the outputs with either the last
value or the substitute value
Copies the state of the physical inputs to I
memory
C
Executes the startup OBs
Executes the program cycle OBs
D Copies the state of the physical inputs to I
memory
Performs self-test diagnostics
E Stores any interrupt events into the queue to
be processed in RUN mode
Processes interrupts and communications
during any part of the scan cycle
F Enables the writing of the output (or "Q")
memory to the physical outputs
You can change the default behavior for a module by removing it from this automatic update
of I/O. You can also immediately read and write digital and analog I/O values to the modules
when an instruction executes. Immediate reads of physical inputs do not update the process
image input area. Immediate writes to physical outputs update both the process image
output area and the physical output point.
4.2
Operating modes of the CPU
The CPU has three modes of operation: STOP mode, STARTUP mode, and RUN mode.
Status LEDs on the front of the CPU indicate the current mode of operation.
In STOP mode, the CPU is not executing the program, and you can download a project.
The RUN/STOP LED is solid yellow.
In STARTUP mode, the CPU executes any startup logic (if present). The CPU does not
process interrupt events during the startup mode. The RUN/STOP LED alternates
flashing between green and yellow.
In RUN mode, the scan cycle executes repeatedly. Interrupt events can occur and the
CPU can process them at any point within the program cycle phase. You can download
some parts of a project in RUN mode. The RUN/STOP LED is solid green.
The CPU supports the warm restart method for entering the RUN mode. Warm restart does
not include a memory reset, but you can command a memory reset from STEP 7. A memory
reset clears all work memory, clears retentive and non-retentive memory areas, copies load
memory to work memory, and sets outputs to the configured "Reaction to CPU STOP". A
memory reset does not clear the diagnostics buffer or the permanently saved IP address. A
warm restart initializes all non-retentive system and user data.
PLC concepts made easy
4.3 Execution of the user program
Easy Book
Manual, 03/2014, A5E02486774-AF 53
You can configure the "startup after POWER ON" setting of the CPU complete with restart
method using STEP 7. This configuration item appears under the Device Configuration for
the CPU under Startup. At power up, the CPU performs a sequence of power-up diagnostic
checks and system initialization. During system initialization, the CPU deletes all non-
retentive bit memory and resets all non-retentive DB contents to initial values. The CPU then
enters the appropriate power-up mode. Certain errors will prevent the CPU from entering the
RUN mode. The CPU supports the following power-up modes: STOP mode, "Go to RUN
mode after warm restart", and "Go to previous mode after warm restart".
NOTICE
Warm restart mode configuration
The CPU can enter STOP mode due to repairable faults, such as failure of a replaceable
signal module, or temporary faults, such as power line disturbance or erratic power up
event.
If the CPU has been configured to "Warm restart mode prior to POWER OFF", it will not
return to RUN mode when the fault is repaired or removed until it receives a new command
from STEP 7 to go to RUN. Without a new command, the STOP mode is retained as the
mode prior to POWER OFF.
CPUs that are intended to operate independently of a STEP 7 connection should typically
be configured to "Warm restart - RUN" so that the CPU can be returned to RUN mode by a
power cycle following the removal of fault conditions.
The CPU does not provide a physical switch for changing the
operating mode. To change the operating mode of the CPU, STEP
7
provides the following tools:
"Stop" and "Run" buttons on the STEP 7 toolbar
CPU operator panel in the online tools
You can also include a STP instruction in your program to change the CPU to STOP mode.
This allows you to stop the execution of your program based on the program logic.
4.3
Execution of the user program
The CPU supports the following types of code blocks that allow you to create an efficient
structure for your user program:
Organization blocks (OBs) define the structure of the program. Some OBs have
predefined behavior and start events, but you can also create OBs with custom start
events (Page 55).
Functions (FCs) and function blocks (FBs) contain the program code that corresponds to
specific tasks or combinations of parameters. Each FC or FB provides a set of input and
output parameters for sharing data with the calling block. An FB also uses an associated
data block (called an instance DB) to maintain state of values between execution that can
be used by other blocks in the program.
Data blocks (DBs) store data that can be used by the program blocks.
PLC concepts made easy
4.3 Execution of the user program
Easy Book
54 Manual, 03/2014, A5E02486774-AF
The size of the user program, data, and configuration is limited by the available load memory
and work memory in the CPU (Page 15). There is no specific limit to the number of each
individual OB, FC, FB and DB block. However, the total number of blocks is limited to 1024.
4.3.1
Processing the scan cycle in RUN mode
For each scan cycle, the CPU writes the outputs, reads the inputs, executes the user
program, updates communication modules, and responds to user interrupt events and
communication requests. Communication requests are handled periodically throughout the
scan.
These actions (except for user interrupt events) are serviced regularly and in sequential
order. User interrupt events that are enabled are serviced according to priority in the order in
which they occur. For interrupt events, the CPU reads the inputs, executes the OB, and then
writes the outputs, using the associated process image partition (PIP), if applicable.
The system guarantees that the scan cycle will be completed in a time period called the
maximum cycle time; otherwise a time error event is generated.
Each scan cycle begins by retrieving the current values of the digital and analog outputs
from the process image and then writing them to the physical outputs of the CPU, SB,
and SM modules configured for automatic I/O update (default configuration). When a
physical output is accessed by an instruction, both the output process image and the
physical output itself are updated.
The scan cycle continues by reading the current values of the digital and analog inputs
from the CPU, SB, and SMs configured for automatic I/O update (default configuration),
and then writing these values to the process image. When a physical input is accessed
by an instruction, the value of the physical input is accessed by the instruction, but the
input process image is not updated.
After reading the inputs, the user program is executed from the first instruction through
the end instruction. This includes all the program cycle OBs plus all their associated FCs
and FBs. The program cycle OBs are executed in order according to the OB number with
the lowest OB number executing first.
Communications processing occurs periodically throughout the scan, possibly interrupting
user program execution.
Self-diagnostic checks include periodic checks of the system and the I/O module status
checks.
Interrupts can occur during any part of the scan cycle, and are event-driven. When an event
occurs, the CPU interrupts the scan cycle and calls the OB that was configured to process
that event. After the OB finishes processing the event, the CPU resumes execution of the
user program at the point of interruption.
PLC concepts made easy
4.3 Execution of the user program
Easy Book
Manual, 03/2014, A5E02486774-AF 55
4.3.2
OBs help you structure your user program
OBs control the execution of the user program. Specific events in the CPU trigger the
execution of an organization block. OBs cannot call each other or be called from an FC or
FB. Only an event such as a diagnostic interrupt or a time interval, can start the execution of
an OB. The CPU handles OBs according to their respective priority classes, with higher
priority OBs executing before lower priority OBs. The lowest priority class is 1 (for the main
program cycle), and the highest priority class is 24.
4.3.3
Event execution priorities and queuing
The CPU processing is controlled by events. An event triggers an interrupt OB to be
executed. You can specify the interrupt OB for an event during the creation of the block,
during the device configuration, or with an ATTACH or DETACH instruction. Some events
happen on a regular basis like the program cycle or cyclic events. Other events happen only
a single time, like the startup event and time delay events. Some events happen when the
hardware triggers an event, such as an edge event on an input point or a high speed counter
event. Events like the diagnostic error and time error event only happen when an error
occurs. The event priorities and queues are used to determine the processing order for the
event interrupt OBs.
The CPU processes events in order of priority where 1 is the lowest priority and 26 is the
highest priority. Prior to V4.0 of the S7-1200 CPU, each type of OB belonged to a fixed
priority class (1 to 26). With V4.0, you can assign a priority class to each OB that you
configure. You configure the priority number in the attributes of the OB properties.
Interruptible and non-interruptible execution modes
OBs execute in priority order of the events that trigger them. With V4.0 of the S7-1200 CPU,
you can configure OB execution to be interruptible or non-interruptible. Note that program
cycle OBs are always interruptible, but you can configure all other OBs to be either
interruptible or non-interruptible.
If you set interruptible mode, then if an OB is executing and a higher priority event occurs
before the OB completes its execution, the running OB is interrupted to allow the higher-
priority event OB to run. The higher-priority event runs, and at its completion, the OB that
was interrupted continues. When multiple events occur while an interruptible OB is
executing, the CPU processes those events in priority order.
If you do not set interruptible mode, then an OB runs to completion when triggered
regardless of any other events that trigger during the time that it is running.
PLC concepts made easy
4.3 Execution of the user program
Easy Book
56 Manual, 03/2014, A5E02486774-AF
Consider the following two cases where interrupt events trigger a cyclic OB and a time delay
OB. In both cases, the time delay OB (OB201) has no process image partition assignment
and executes at priority 4. The cyclic OB (OB200) has a process image partition assignment
of PIP1 and executes at priority 2. The following illustrations show the difference in execution
between non-interruptible and interruptible execution modes:
Figure 4-1 Case 1: Non-interruptible OB execution
Figure 4-2 Case 2: Interruptible OB execution
Note
If you configure the OB execution mode to be non
-interruptible, then a time error OB cannot
interrupt OBs other than program cycle OBs. Prior to V4.0 of the S7
-1200 CPU, a time error
OB could interrupt any executing OB. With V4.0, you must configure OB execution to be
interruptible if you want a time error OB (or any
other higher priority OB) to be able to
interrupt executing OBs that are not program cycle OBs.
Understanding event execution priorities and queuing
The number of pending (queued) events from a single source is limited, using a different
queue for each event type. Upon reaching the limit of pending events for a given event type,
the next event is lost. Refer to the topic about time error interrupt OBs for more information
regarding queue overflows.
Each CPU event has an associated priority. In general, the CPU services events in order of
priority (highest priority first). The CPU services events of the same priority on a "first-come,
first-served" basis.
PLC concepts made easy
4.3 Execution of the user program
Easy Book
Manual, 03/2014, A5E02486774-AF 57
Table 4- 1 OB events
Event
Quantity allowed
Default OB priority
Program cycle 1 program cycle event
Multiple OBs allowed
14
Startup 1 startup event 1
Multiple OBs allowed
14
Time delay Up to 4 time events
1 OB per event
3
Cyclic interrupt Up to 4 events
1 OB per event
8
Hardware interrupt Up to 50 hardware interrupt events2
1 OB per event, but you can use the same OB for multiple
events
18
18
Time error
1 event (only if configured)
3
22 or 26
4
Diagnostic error
1 event (only if configured)
5
Pull or plug of modules
1 event
6
Rack or station failure
1 event
6
Time of day
Up to 2 events
2
Status 1 event 4
Update
1 event
4
Profile 1 event 4
1
The startup event and the program cycle event never occur at the same time because the startup event runs to
completion before the program cycle event starts.
2
You can have more than 50 hardware interrupt event OBs if you use the DETACH and ATTACH instructions.
3
You can configure the CPU to stay in RUN if the scan cycle exceeds the maximum scan cycle time or you can use the
RE_TRIGR instruction to reset the cycle time. However, the CPU goes to STOP mode the second time that one scan
cycle exceeds the maximum scan cycle time.
4
The priority for a new V4.0 CPU is 22. If you exchange a V3.0 CPU for a V4.0 CPU, the priority is 26, the priority that
was in effect for V3.0.
In either case, the priority field is editable and you can set the priority to any value in the range 22
to 26.
Refer to the topic "Exchanging a V3.0 CPU for a V4.0 CPU" for more details.
In addition, the CPU recognizes other events that do not have associated OBs. The following
table describes these events and the corresponding CPU actions:
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
58 Manual, 03/2014, A5E02486774-AF
Table 4- 2 Additional events
Event
Description
CPU action
I/O access error Direct I/O read/write error The CPU logs the first occurrence in the diagnostic
buffer and stays in RUN mode.
Max cycle time error CPU exceeds the configured cycle time
twice
The CPU logs the error in the diagnostic buffer and
transitions to STOP mode.
Peripheral access error I/O error during process image update The CPU logs the first occurrence in the diagnostic
buffer and stays in RUN mode.
Programming error program execution error If the block with the error provides error handling, it
updates the error structure; if not, the CPU logs the
error in the diagnostic buffer and stays in RUN
mode.
Interrupt latency
The interrupt event latency (the time from notification of the CPU that an event has occurred
until the CPU begins execution of the first instruction in the OB that services the event) is
approximately 175 µsec, provided that a program cycle OB is the only event service routine
active at the time of the interrupt event.
See also
Going online to monitor the values in the CPU (Page 259)
4.4
Memory areas, addressing and data types
The CPU provides the following memory areas to store the user program, data, and
configuration:
Load memory is non-volatile storage for the user program, data and configuration. When
a project is downloaded to the CPU, it is first stored in the Load memory area. This area
is located either in a memory card (if present) or in the CPU. This non-volatile memory
area is maintained through a power loss. You can increase the amount of load memory
available for data logs by installing a memory card.
Work memory is volatile storage for some elements of the user project while executing
the user program. The CPU copies some elements of the project from load memory into
work memory. This volatile area is lost when power is removed, and is restored by the
CPU when power is restored.
Retentive memory is non-volatile storage for a limited quantity of work memory values.
The retentive memory area is used to store the values of selected user memory locations
during power loss. When a power down or power loss occurs, the CPU restores these
retentive values upon power up.
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
Manual, 03/2014, A5E02486774-AF 59
An optional SIMATIC memory card provides an alternative memory for
storing your user program or a means for transferring your program. If you
use the memory card, the CPU runs the program from the memory card
and not from the memory in the CPU.
Check that the memory card is not write
-protected. Slide the protection
switch
away from the "Lock" position.
Use the optional SIMATIC memory card as a program card, as a transfer card, for collecting
data log files, or to perform a firmware update.
Use the transfer card to copy your project to multiple CPUs without using STEP 7. The
transfer card copies a stored project from the card to the memory of the CPU. You must
remove the transfer card after copying the program to the CPU.
The program card takes the place of CPU memory; all of your CPU functions are
controlled by the program card. Inserting the program card erases all of the internal load
memory of the CPU (including the user program and any forced I/O). The CPU then
executes the user program from the program card.
You can also use the program card for collecting data log files (Page 112). The program
card provides more memory than the internal memory of the CPU. The Web server
function (Page 193) of the CPU allows you to download the data log files to a computer.
You can also use a memory card to perform a firmware update. Refer to the S7-1200
System Manual for instructions.
Note
The program card must
remain in the CPU. If you remove the program card, the CPU goes
to STOP mode.
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
60 Manual, 03/2014, A5E02486774-AF
4.4.1
Data types supported by the S7-1200
Data types are used to specify both the size of a data element as well as how the data are to
be interpreted. Each instruction parameter supports at least one data type, and some
parameters support multiple data types. Hold the cursor over the parameter field of an
instruction to see which data types are supported for a given parameter.
Table 4- 3 Data types supported by the S7-1200
Data types
Description
Bit and bit-sequence
data types
Bool is a Boolean or bit value.
Byte is an 8-bit byte value.
Word is a 16-bit value.
DWord is a 32-bit double-word value.
Integer data types USInt (unsigned 8-bit integer) and SInt (signed 8-bit integer) are "short" integers (8 bits or 1
byte of memory) that can be signed or unsigned.
UInt (unsigned 16-bit integer) and Int (signed 16-bit integer) are integers (16 bits or 1 word of
memory) that can be signed or unsigned.
UDInt (unsigned 32-bit integer) and DInt (signed 32-bit integer) are double integers (32 bits or
1 double-word of memory) that can be signed or unsigned.
Real number data
types
Real is a 32-bit Real number or floating-point value.
LReal is a 64-bit Real number or floating-point value.
Date and time data
types
Date is a 16-bit date value (similar to a UInt) that contains the number of days since January
1, 1990. The maximum date value is 65378 (16#FF62), which corresponds to December 31,
2168. All possible Date values are valid.
DTL (date and time long) is a structure of 12 bytes that saves information on date and time in
a predefined structure.
Year (UInt): 1970 to 2554
Month (USInt): 1 to 12
Day (USInt): 1 to 31
Weekday (USInt): 1 (Sunday) to 7 (Saturday)
Hours (USInt): 0 to 23
Minutes (USInt): 0 to 59
Seconds (USInt): 0 to 59
Nanoseconds (UDInt): 0 to 999999999
Time is a 32-bit IEC time value (similar to a Dint) that stores the number of milliseconds (from
0 to 24 days 20 hours 31 minutes 23 seconds and 647 ms). All possible Time values are
valid. Time values can be used for calculations, and negative times are possible.
TOD (time of day) is a 32-bit time-of-day value (similar to a Dint) that contains the number of
milliseconds since midnight (from 0 to 86399999).
Character and string
data types
Char is an 8-bit single character.
String is a variable-length string of up to 254 characters.
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
Manual, 03/2014, A5E02486774-AF 61
Data types
Description
Array and structure
data types
Array contains multiple elements of the same data type. Arrays can be created in the block
interface editors for OB, FC, FB, and DB. You cannot create an array in the PLC tags editor.
Struct defines a structure of data consisting of other data types. The Struct data type can be
used to handle a group of related process data as a single data unit. You declare the name
and internal data structure for the Struct data type in the data block editor or a block interface
editor.
Arrays and structures can also be assembled into a larger structure. A structure can be nested
up to eight levels deep. For example, you can create a structure of structures that contain arrays.
PLC data types PLC Data type is a user-defined data structure that defines a custom data structure that you can
use multiple times in your program. When you create a PLC Data type, the new PLC Data type
appears in the data type selector drop drop-lists in the DB editor and code block interface editor.
PLC Data types can be used directly as a data type in a code block interface or in data blocks.
PLC Data types can be used as a template for the creation of multiple global data blocks that use
the same data structure.
Pointer data types Pointer provides an indirect reference to the address of a tag. It occupies 6 bytes (48 bits) in
memory and can include the following information to a variable: DB number (or 0 if the data is
not stored in a DB), memory area in the CPU, and the memory address.
Any provides an indirect reference to the beginning of a data area and identifies its length.
The Any pointer uses 10 bytes in memory and can include the following information: Data
type of the data elements, number of data elements, memory area or DB number, and the
"Byte.Bit" starting address of the data.
Variant provides an indirect reference to tags of different data types or parameters. The
Variant pointer recognizes structures and individual structural components. The Variant does
not occupy any space in memory.
Although not available as data types, the following BCD (binary coded decimal) numeric
formats are supported by the conversion instructions.
BCD16 is a 16-bit value (-999 to 999).
BCD32 is a 32-bit value (-9999999 to 9999999).
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
62 Manual, 03/2014, A5E02486774-AF
4.4.2
Addressing memory areas
STEP 7 facilitates symbolic programming. You create symbolic names or "tags" for the
addresses of the data, whether as PLC tags relating to memory addresses and I/O points or
as local variables used within a code block. To use these tags in your user program, simply
enter the tag name for the instruction parameter. For a better understanding of how the CPU
structures and addresses the memory areas, the following paragraphs explain the "absolute"
addressing that is referenced by the PLC tags. The CPU provides several options for storing
data during the execution of the user program:
Global memory: The CPU provides a variety of specialized memory areas, including
inputs (I), outputs (Q) and bit memory (M). This memory is accessible by all code blocks
without restriction.
Data block (DB): You can include DBs in your user program to store data for the code
blocks. The data stored persists when the execution of the associated code block comes
to an end. A "global" DB stores data that can be used by all code blocks, while an
instance DB stores data for a specific FB and is structured by the parameters for the FB.
Temp memory: Whenever a code block is called, the operating system of the CPU
allocates the temporary, or local, memory (L) to be used during the execution of the
block. When the execution of the code block finishes, the CPU reallocates the local
memory for the execution of other code blocks.
Each different memory location has a unique address. Your user program uses these
addresses to access the information in the memory location.
References to the input (I) or output (Q) memory areas, such as I0.3 or Q1.7, access the
process image. To immediately access the physical input or output, append the reference
with ":P" (such as I0.3:P, Q1.7:P, or "Stop:P").
Forcing applies a fixed value to a physical input (Ix.y:P) or a physical output (Qx.y:P) only.
To force an input or output, append a ":P" to the PLC tag or the address. For more
information, see "Forcing variables in the CPU" (Page 261).
Table 4- 4 Memory areas
Memory area
Description
Force
Retentive
I
Process image input
I_:P1
(Physical input)
Copied from physical inputs at the beginning of the scan
cycle
No No
Immediate read of the physical input points on the CPU,
SB, and SM
Yes No
Q
Process image output
Q_:P1
(Physical output)
Copied to physical outputs at the beginning of the scan
cycle
No No
Immediate write to the physical output points on the
CPU, SB, and SM
Yes No
M
Bit memory
Control and data memory No Yes
(optional)
L
Temp memory
Temporary data for a block local to that block No No
DB
Data block
Data memory and also parameter memory for FBs No Yes
(optional)
1
To immediately access (or to force) the physical inputs and physical outputs, append a ":P" to the address or tag (such
as I0.3:P, Q1.7:P, or "Stop:P").
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
Manual, 03/2014, A5E02486774-AF 63
Each different memory location has a unique address. Your user program uses these
addresses to access the information in the memory location. The absolute address consists
of the following elements:
Memory area (such as I, Q, or M)
Size of the data to be accessed (such as "B" for Byte or "W" for Word)
Address of the data (such as Byte 3 or Word 3)
When accessing a bit in the address for a Boolean value, you do not enter a mnemonic for
the size. You enter only the memory area, the byte location, and the bit location for the data
(such as I0.0, Q0.1, or M3.4).
Absolute address of a memory area:
A
Memory area identifier
B
Byte address: byte 3
C
Separator ("byte.bit")
D
Bit location of the byte (bit 4 of 8)
E
Bytes of the memory area
F
Bits of the selected byte
In the example, the memory area and byte address (M = bit memory area, and 3 = Byte 3)
are followed by a period (".") to separate the bit address (bit 4).
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
64 Manual, 03/2014, A5E02486774-AF
Configuring the I/O in the CPU and I/O modules
When you add a CPU and I/O modules to your
configuration screen, I and Q addresses are
automatically assigned. You can change the
default addressing by selecting the address field in
the device configuration and typing new
numbers.
Digital inputs and outputs are assigned in
groups of 8 points (1 byte), whether the module
uses all the points or not.
Analog inputs and outputs are assigned in
groups of 2 points (4 bytes).
The figure shows an example of a CPU 1214C with two SMs and one SB. In this example,
you could change the address of the DI8 module to 2 instead of 8. The tool assists you by
changing address ranges that are the wrong size or conflict with other addresses.
4.4.3
Accessing a "slice" of a tagged data type
PLC tags and data block tags can be accessed at the bit, byte, or word level depending on
their size. The syntax for accessing such a data slice is as follows:
"<PLC tag name>".xn (bit access)
"<PLC tag name>".bn (byte access)
"<PLC tag name>".wn (word access)
"<Data block name>".<tag name>.xn (bit access)
"<Data block name>".<tag name>.bn (byte access)
"<Data block name>".<tag name>.wn (word access)
A double word-sized tag can be accessed by bits 0 - 31, bytes 0 - 3, or word 0 - 1. A word-
sized tag can be accessed by bits 0 - 15, bytes 0 - 1, or word 0. A byte-sized tag can be
accessed by bits 0 - 7, or byte 0. Bit, byte, and word slices can be used anywhere that bits,
bytes, or words are expected operands.
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
Manual, 03/2014, A5E02486774-AF 65
Note
Valid data types that can be accessed by slice are Byte, Char, Conn_Any, Date, DInt,
DWord, Event_Any, Event_Att, Hw_Any, Hw_Device, HW_Interface, Hw_Io, Hw_Pwm,
Hw_Sub
Module, Int, OB_Any, OB_Att, OB_Cyclic, OB_Delay, OB_WHINT, OB_PCYCLE,
OB_STARTUP, OB_TIMEERROR, OB_Tod, Port, Rtm, SInt, Time, Time_Of_Day, UDInt,
UInt, USInt, and Word. PLC Tags of type Real can be accessed by slice, but data block tags
of type Real cann
ot.
Examples
In the PLC tag table, "DW" is a declared tag of type DWORD. The examples show bit, byte,
and word slice access:
LAD
FBD
SCL
Bit access
IF "DW".x11 THEN
...
END_IF;
Byte access
IF "DW".b2 = "DW".b3
THEN
...
END_IF;
Word access
out:= "DW".w0 AND
"DW".w1;
4.4.4
Accessing a tag with an AT overlay
The AT tag overlay allows you to access an already-declared tag of a standard access block
with an overlaid declaration of a different data type. You can, for example, address the
individual bits of a tag of a Byte, Word, or DWord data type with an Array of Bool.
PLC concepts made easy
4.4 Memory areas, addressing and data types
Easy Book
66 Manual, 03/2014, A5E02486774-AF
Declaration
To overlay a parameter, declare an additional parameter directly after the parameter that is
to be overlaid and select the data type "AT". The editor creates the overlay, and you can
then choose the data type, struct, or array that you wish to use for the overlay.
Example
This example shows the input parameters of a standard-access FB. The byte tag B1 is
overlaid with an array of Booleans:
Table 4- 5 Overlay of a byte with a Boolean array
7
6
5
4
3
2
1
0
AT[0]
AT[1]
AT[2]
AT[3]
AT[4]
AT[5]
AT[6]
AT[7]
Another example is a DWord tag overlaid with a Struct:
The overlay types can be addressed directly in the program logic:
LAD
FBD
SCL
IF #AT[1] THEN
...
END_IF;
IF (#DW1_Struct.S1 =
W#16#000C) THEN
...
END_IF;
out1 := #DW1_Struct.S2;
PLC concepts made easy
4.5 Pulse outputs
Easy Book
Manual, 03/2014, A5E02486774-AF 67
Rules
Overlaying of tags is only possible in FB and FC blocks with standard access.
You can overlay parameters for all block types and all declaration sections.
An overlaid parameter can be used like any other block parameter.
You cannot overlay parameters of type VARIANT.
The size of the overlaying parameter must be less than or equal to the size of the overlaid
parameter.
The overlaying variable must be declared immediately after the variable that it overlays
and identified with the keyword "AT".
4.5
Pulse outputs
The CPU or signal board (SB) can be configured to provide four pulse generators for
controlling high-speed pulse output functions, either as pulse-width modulation (PWM) or as
pulse-train output (PTO). The basic motion instructions use PTO outputs. You can assign
each pulse generator to either PWM or PTO, but not both at the same time.
Pulse outputs cannot be used by other instructions in the
us
er program. When you configure the outputs of the
CPU or SB as pulse generators, the corresponding
output addresses are removed from the Q memory and
cannot be used for other purposes in your user program.
If your user program writes a value to an output u
sed as
a pulse generator, the CPU does not write that value to
the physical output.
PLC concepts made easy
4.5 Pulse outputs
Easy Book
68 Manual, 03/2014, A5E02486774-AF
Note
Do not exceed the maximum pulse frequency.
The maximum pulse frequency of the pulse output generators is 1 MHz for the CPU 1217C
and 100 KHz for CPUs 1211C, 1212C
, 1214C, and 1215C; 20 KHz (for a standard SB); or
200 KHz (for a high
-speed SB).
The four pulse generators have default I/O assignments; however, they can be configured to
any digital output on the CPU or SB. Pulse generators on the CPU cannot be assigned
to
distributed I/O.
When configuring the basic motion instructions, be aware that STEP
7 does
not
alert you if
you configure an axis with a maximum speed or frequency that exceeds this hardware
limitation. This could cause problems with your application, so always ensure that you do not
exceed the maximum pulse frequency of the hardware.
You can use onboard CPU outputs, or you can use the optional signal board outputs. The
output point numbers are shown in the following table (assuming the default output
configuration). If you have changed the output point numbering, then the output point
numbers will be those you assigned. Note that PWM requires only one output, while PTO
can optionally use two outputs per channel. If an output is not required for a pulse function, it
is available for other uses.
The four pulse generators have default I/O assignments; however, they can be configured to
any digital output on the CPU or SB. Pulse generators on the CPU cannot be assigned to
SMs or to distributed I/O.
Table 4- 6 Default output assignments for the pulse generators
Description
Pulse
Direction
PTO1
Built-in I/O
Q0.0
Q0.1
SB I/O
Q4.0
Q4.1
PWM1
Built-in outputs
Q0.0
-
SB outputs
Q4.0
-
PTO2
Built-in I/O
Q0.2
Q0.3
SB I/O
Q4.2
Q4.3
PWM2
Built-in outputs
Q0.2
-
SB outputs Q4.2 -
PTO3
Built-in I/O
Q0.4
1
Q0.5
1
SB I/O
Q4.0
Q4.1
PWM3
Built-in outputs
Q0.4
1
-
SB outputs
Q4.1
-
PLC concepts made easy
4.5 Pulse outputs
Easy Book
Manual, 03/2014, A5E02486774-AF 69
Description
Pulse
Direction
PTO4
Built-in I/O
Q0.6
2
Q0.7
2
SB I/O
Q4.2
Q4.3
PWM4
Built-in outputs
Q0.6
2
-
SB outputs
Q4.3
-
1
The CPU 1211C does not have outputs Q0.4, Q0.5, Q0.6, or Q0.7. Therefore, these outputs
cannot be used in the CPU 1211C.
2
The CPU 1212C does not have outputs Q0.6 or Q0.7. Therefore, these outputs cannot be used in
the CPU 1212C.
3
This table applies to the CPU 1211C, CPU 1212C, CPU 1214C, CPU 1215C, and CPU 1217C
PTO/PWM functions.
PLC concepts made easy
4.5 Pulse outputs
Easy Book
70 Manual, 03/2014, A5E02486774-AF
Easy Book
Manual, 03/2014, A5E02486774-AF 71
Easy to create the device configuration
5
You create the device configuration for your PLC by adding a CPU and additional modules to
your project.
Communications module (CM) or communication processor (CP): Up to 3, inserted in slots
101, 102, and 103
CPU: Slot 1
Ethernet port of CPU
Signal board (SB), communication board (CB) or battery board (BB): up to 1, inserted in the
CPU
Signal module (SM) for digital or analog I/O: up to 8, inserted in slots 2 through 9
(CPU 1214C, CPU 1215C and CPU 1217C allow 8, CPU 1212C allows 2, CPU 1211C does
not allow any)
To create the device configuration, add a
device to your project.
In the Portal view, select "Devices &
Networks" and click "Add device".
In the Project view, under the project
name, double-click "Add new device".
Easy to create the device configuration
5.1 Detecting the configuration for an unspecified CPU
Easy Book
72 Manual, 03/2014, A5E02486774-AF
5.1
Detecting the configuration for an unspecified CPU
If you are connected to a CPU, you can upload the
configuration of that CPU, including any modules, to your
project. Simply create a new project and select the "unspecified
CPU" instead of selecting a specific CPU. (You ca
n also skip
the device configuration entirely by selecting the "Create a PLC
program" from the "First steps". STEP 7 then automatically
creates an unspecified CPU.)
Fro
m the program editor, you select the "Hardware detection"
command from the "Online" menu.
From the device configuration editor, you select the option for detecting the configuration of
the connected device.
After you select the CPU from the online dialog and click the Load button, STEP 7 uploads
the hardware configuration from the CPU, including any modules (SM, SB, or CM). You can
then configure the parameters for the CPU and the modules (Page 76).
Easy to create the device configuration
5.2 Adding a CPU to the configuration
Easy Book
Manual, 03/2014, A5E02486774-AF 73
5.2
Adding a CPU to the configuration
You create your device configuration by inserting
a CPU into your project. Select the CPU in the
"Add a new device" dialog and click "OK" to add
the CPU to the project.
The Device view shows the
CPU
and rack.
Selecting the CPU in the Device view
displays the CPU properties in the
inspector window. Use these properties
to configure the operational parameters
of the CPU (Page 76).
Note
The CPU does not have a pre
-configured IP address. You must manually assign an IP
addre
ss for the CPU during the device configuration. If your CPU is connected to a router on
the network, you also enter the IP address for a router.
Easy to create the device configuration
5.3 Changing a device
Easy Book
74 Manual, 03/2014, A5E02486774-AF
5.3
Changing a device
You can change the device type of a configure CPU or module. From Device configuration,
right-click the device and select "Change device" from the context menu. From the dialog,
navigate to and select the CPU or module that you want to replace. The Change device
dialog shows you combatibility information between the two devices.
Note
Device exchange: replacing a V3.0 CPU with a V4.0 CPU
You can open a STEP
7 V12 project in STEP 7 V13 and replace V3.0 CPUs with V4.0
CPUs. You
cannot replace CPUs that are from versions prior to V3.0. When you replace a
V3.0 CPU with a V4.0 CPU, consider the
differences (Page 345) in features and behavior
between the two versions, and actions you must take.
If you have a project for a CPU version older than V3.0, you can upgrade that project first to
V3.0 and then upgrade the V3.0 project to V4.0.
5.4
Adding modules to the configuration
Use the hardware catalog to add modules to the CPU:
Signal module (SM) provides additional digital or analog I/O points. These modules are
connected to the right side of the CPU.
Signal board (SB) provides just a few additional I/O points for the CPU. The SB is
installed on the front of the CPU.
Battery Board 1297 (BB) provides long-term backup of the realtime clock. The BB is
installed on the front of the CPU.
Communication board (CB) provides an additional communication port (such as RS485).
The CB is installed on the front of the CPU.
Communication module (CM) and communication processor (CP) provide an additional
communication port, such as for PROFIBUS or GPRS. These modules are connected to
the left side of the CPU.
To insert a module into the device configuration, select the module in the hardware catalog
and either double-click or drag the module to the highlighted slot. You must add the modules
to the device configuration and download the hardware configuration to the CPU for the
modules to be functional.
Easy to create the device configuration
5.4 Adding modules to the configuration
Easy Book
Manual, 03/2014, A5E02486774-AF 75
Table 5- 1 Adding a module to the device configuration
Module
Select the module
Insert the module
Result
SM
SB, BB or
CB
CM or CP
Easy to create the device configuration
5.5 Configuring the operation of the CPU and modules
Easy Book
76 Manual, 03/2014, A5E02486774-AF
5.5
Configuring the operation of the CPU and modules
To configure the operational parameters for the CPU, select the CPU in the Device view and
use the "Properties" tab of the inspector window.
You can configure the following CPU properties:
PROFINET IP address and time
synchronization for the CPU
Startup behavior of the CPU following an OFF-
to-ON power transition
Local (on-board) digital and analog I/O, high-
speed counters (HSC), and pulse generators
System clock (time, time zone and daylight
saving time)
Read/write protection and password for
accessing the CPU
Maximum cycle time or a fixed minimum cycle
time and communications load
Web server properties
Configuring the STOP-to-RUN operation of the CPU
Whenever the operating state changes from STOP to RUN, the CPU clears the process
image inputs, initializes the process image outputs, and processes the startup OBs.
(Therefore, any read accesses to the process-image inputs by instructions in the startup OBs
will read zero rather than the current physical input value.) To read the current state of a
physical input during startup, you must perform an immediate read. The startup OBs and any
associated FCs and FBs are executed next. If more than one startup OB exists, each is
executed in order according to the OB number, with the lowest OB number executing first.
The CPU also performs the following tasks during the startup processing.
Interrupts are queued but not processed during the startup phase
No cycle time monitoring is performed during the startup phase
Configuration changes to HSC (high-speed counter), PWM (pulse-width modulation), and
PtP (point-to-point communication) modules can be made in startup
Actual operation of HSC, PWM, and point-to-point communication modules only occurs in
RUN
After the execution of the startup OBs finishes, the CPU goes to RUN mode and processes
the control tasks in a continuous scan cycle.
Use the CPU properties to configure how the CPU starts up after a power cycle.
Easy to create the device configuration
5.5 Configuring the operation of the CPU and modules
Easy Book
Manual, 03/2014, A5E02486774-AF 77
In STOP mode
In RUN mode
In the previous
mode (prior to the
power cycle)
The CPU performs a warm restart before going to RUN mode. Warm restart resets all non-
retentive memory to the default start values, but the CPU retains the current values stored in
the retentive memory.
Note
The CPU always performs a restart after a download
Whenever you download an element of your project (such as a program block, data block, or
hardware configuration), the CPU performs a restart on the next transition to RUN mode. In
addition to clearing the inputs, initializing the outp
uts and initializing the non-retentive
memory, the restart also initializes the retentive memory areas.
After the restart that follows a download, all subsequent STOP
-to-RUN transitions perform a
warm restart (that does not initialize the retentive memory)
.
5.5.1
System memory and clock memory provide standard functionality
You use the CPU properties to enable bytes for "system memory" and "clock memory". Your
program logic can reference the individual bits of these functions by their tag names.
You can assign one byte in M memory for system memory. The byte of system memory
provides the following four bits that can be referenced by your user program by the
following tag names:
First cycle: (Tag name "FirstScan") bit is set to1 for the duration of