0% found this document useful (0 votes)
590 views41 pages

Programming Recommendation For PLC S7 300 en

The goal of this application is to provide the STEP 7 V5.x project with a SINUMERIK with an integrated S7-300 PLC for the migration to STEP 7 (TIA Portal) and to a successor generation of SINUMERIK.

Uploaded by

auduser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
590 views41 pages

Programming Recommendation For PLC S7 300 en

The goal of this application is to provide the STEP 7 V5.x project with a SINUMERIK with an integrated S7-300 PLC for the migration to STEP 7 (TIA Portal) and to a successor generation of SINUMERIK.

Uploaded by

auduser
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Programming

recommendation for
PLC S7-300
SINUMERIK
Siemens
SINUMERIK 840D sl, from SW 4.5 Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109478721 Support
Warranty and liability

Warranty and liability

Note The application examples are not binding and do not claim to be complete
regarding the circuits shown, equipment and any other eventuality. The
application examples do not represent customer-specific solutions. They are only
intended to provide support for typical applications. You are responsible for
ensuring that the described products are used correctly. These application
examples do not relieve you of the responsibility to use safe practices in
application, installation, operation, and maintenance. When using these
application examples, you recognize that we cannot be made liable for any
damage/claims beyond the liability clause described. We reserve the right to
make changes to these application examples at any time without prior notice.
If there are any deviations between the recommendations provided in these
application examples and other Siemens publications e.g. Catalogs the
contents of the other documents have priority.

We do not accept any liability for the information contained in this document.

Any claims against us based on whatever legal reason resulting from the use of
the examples, information, programs, engineering and performance data, etc.
described in this application example, shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act ("Produkthaftungsgesetz"), in case of intent, gross negligence or injury of life,
Siemens AG 2017 All rights reserved

body or health, guarantee for the quality of a product, fraudulent concealment of a


deficiency or breach of a condition which goes to the root of the contract
("wesentliche Vertragspflichten"). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body, or health. The above provisions do not imply a change in the burden of
proof to your detriment.

Any form of duplication or distribution of these application examples or excerpts


thereof is prohibited without the express consent of Siemens Industry Sector.

Security Siemens provides products and solutions with industrial security functions that
informati support the secure operation of plants, solutions, machines, equipment, and/or
on networks. They are important components in a holistic industrial security
concept. With this in mind, Siemens' products and solutions undergo continuous
development. Siemens recommends strongly that you regularly check for
product updates.
For the secure operation of Siemens products and solutions, it is necessary to
take suitable preventive action (e.g. cell protection concept) and integrate each
component into a holistic, state-of-the-art industrial security concept. Third-party
products that may be in use should also be considered. For more information
about industrial security, visit http://www.siemens.com/industrialsecurity.
To stay informed about product updates as they occur, sign up for a product-
specific newsletter. For more information, visit
http://support.automation.siemens.com.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 2
Table of contents

Table of contents
Warranty and liability ................................................................................................... 2
1 Task ..................................................................................................................... 5
1.1 Overview............................................................................................... 5
1.2 Requirements/scenarios....................................................................... 5
1.2.1 Symbolic programming......................................................................... 5
1.2.2 Optimized block access (S7-1500) ...................................................... 6
1.2.3 STEP 7 (TIA Portal) Compiler and IEC check...................................... 6
2 Preconditions ..................................................................................................... 7
2.1 Software ............................................................................................... 7
2.2 Hardware .............................................................................................. 7
2.3 Knowledge ............................................................................................ 9
3 Preparations in STEP 7 V5.x project .............................................................. 10
Preparatory programming .................................................................. 10
3.1 Symbols .............................................................................................. 10
3.1.1 Absolute and symbolic programming ................................................. 10
3.1.2 Advantages of symbolic addressing ................................................... 10
3.1.3 Integrated definition and use of symbols ............................................ 11
3.1.4 Address priority .................................................................................. 11
3.2 Blocks ................................................................................................. 14
3.2.1 Naming of blocks ................................................................................ 14
Siemens AG 2017 All rights reserved

3.2.2 Declaration of the block parameters .................................................. 14


3.2.3 Blocks in the project ........................................................................... 14
3.3 Programming ...................................................................................... 15
3.3.1 Fully qualified addressing ................................................................... 15
3.3.2 Use of the local data stack ................................................................. 15
3.3.3 Data type conversion .......................................................................... 17
3.3.4 Initial deletion in OB100 ..................................................................... 18
3.3.5 Evaluation of the enable output ENO ................................................. 19
3.3.6 Working with Struct of Bool ................................................................ 19
3.4 Configuration ...................................................................................... 22
3.4.1 General information ............................................................................ 22
3.4.2 Consistency check ............................................................................. 22
3.4.3 Hardware ............................................................................................ 24
3.5 Structure ............................................................................................. 24
3.5.1 Nesting depth ..................................................................................... 24
3.5.2 Interface variables possible instead of global variables ..................... 24
3.5.3 Global data blocks instead of flags .................................................... 26
4 STEP 7 (TIA Portal) .......................................................................................... 27
4.1 New features ...................................................................................... 27
4.1.1 Inspector window................................................................................ 27
4.1.2 Library................................................................................................. 28
4.1.3 Version management ......................................................................... 28
4.1.4 Folder structure .................................................................................. 29
4.2 Configuration ...................................................................................... 30
4.2.1 Addressing of the machine control panel ........................................... 30
5 Comparison of SINUMERIK Toolbox and SINUMERIK TIA Portal
Toolbox ............................................................................................................. 34
5.1 Overview............................................................................................. 34
5.2 Comparison of functions..................................................................... 34
6 Configuration recommendation (step by step) ............................................ 36

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 3
Table of contents

STEP 7 V5.x ....................................................................................... 38


STEP 7 (TIA Portal) V1x (NCU with S7-300) ..................................... 39
7 References ....................................................................................................... 40
8 Contact.............................................................................................................. 41
9 History............................................................................................................... 41
Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 4
1 Task
1.1 Overview

1 Task
1.1 Overview
Introduction

The goal of this application is to provide the STEP 7 V5.x project with a
SINUMERIK with an integrated S7-300 PLC for the migration to STEP 7 (TIA
Portal) and to a successor generation of SINUMERIK.

1.2 Requirements/scenarios
This programming recommendation is intended to support the optimization of the
STEP 7 V5.x programs for the STEP 7 (TIA Portal) with 840D sl and for a later
migration of your projects to NCUs with integrated S7-1500 PLC. If you heed and
implement our recommendations in STEP 7 V5.x, the switchover migration to
STEP 7 (TIA Portal) will be easy.
In addition to the new interface and operator control, STEP 7 (TIA Portal) also
entails additional changes that must be taken into consideration. These changes
are addressed in detail in the following.
Siemens AG 2017 All rights reserved

Note In this document, you will find examples of how you can prepare your STEP 7
V5.x SINUMERIK project in regard to optimized block access and while adhering
to IEC rules.
You can later migrate a project that is prepared in this way to STEP 7 (TIA
Portal) with an NCU with PLC S7-300. In STEP 7 (TIA Portal), the existing
software for a newly created NCU with PLC S7-1500 can be migrated.

1.2.1 Symbolic programming

STEP 7 (TIA Portal) is optimized for symbolic programming. This results in many
benefits that you can also use in STEP 7 V5.x and which make the later switchover
to NCUs with integrated S7-1500 PLC easier. You can program NCUs with
integrated S7-1500 PLC using symbolic addressing without considering the internal
data storage. The controller is concerned with where the data can be saved in a
memory-optimized way.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 5
1 Task
1.2 Requirements/scenarios

1.2.2 Optimized block access (S7-1500)

The optimized block accesses are performance-optimized and are exclusively


programmed symbolically. The use of optimized data blocks makes the program
more efficient because the declared variables are given symbolic names and do
not need permanent addresses. With optimized block access, declared data
elements are automatically arranged in the available memory area of the block in
such a way that the capacity of the block is optimally utilized (Table 1-1: Difference
of data storage default/optimized).
The data is optimally structured and saved for the CPU that is used. The storage is
left to the system. As a result, it is possible to set up data blocks with any structure
without having to consider the physical arrangement of the individual variables.
More on symbolic programming in Chapter 3.1Symbols.

Table 1-1: Difference of data storage default/optimized


Variables Default storage Optimized storage
Siemens AG 2017 All rights reserved

1.2.3 STEP 7 (TIA Portal) Compiler and IEC check

In the TIA Portal, the Compiler works to compile the project according to IEC rules.
Data incompatibilities and errors that can lead to runtime errors are detected as
early as the syntax check by checking the project using Compiler and by applying
the IEC rules.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 6
2 Preconditions
2.1 Software

2 Preconditions
2.1 Software
To be able to carry out a migration of the STEP 7 V5.x SINUMERIK project, the
licensed software listed in the following must be installed, at a minimum:

Table 2-1: Software required for migration


Basis Option
STEP 7 V5.4 SP5 SINUMERIK Toolbox V4.5 SP2
STEP 7 V14SP1 SINUMERIK TIA Portal Toolbox V14SP1

For additional configurations used in the project, the corresponding additional


software must be installed with a valid license

If STEP 7 V5.x and STEP 7 (TIA Portal) are installed on different computers, you
must first convert the project to be migrated to a format that is compatible with the
migration. You need the "Migration Tool TIA Portal" for the conversion. You can
find the migration tool on the product DVD in the
Siemens AG 2017 All rights reserved

"Support/SIMATIC_Migration_Tool_TIA_Vxxxx.exe" folder or it can be downloaded


here: https://support.industry.siemens.com/cs/ww/en/view/58638200
Then copy the converted file onto the PG/PC with the installed STEP 7 (TIA Portal)
software. The file can be migrated there.

2.2 Hardware
The following relevant Siemens product families are supported as of the cited
hardware versions or publication dates:
SINUMERIK 840D sl NCU Type 1B V4.5 SP2
SIMATIC modules, reference date Oct. 1, 2007

To check whether the modules of your project are supported, use the free
Readiness Check Tool prior to the migration
(https://support.industry.siemens.com/cs/de/en/view/60162195).

In Table 2-2: Checking the project with the Readiness Check Tool it is described
how to export the hardware list from your STEP 7 V5.x project and export it in the
Readiness Check Tool.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 7
2 Preconditions
2.2 Hardware

Table 2-2: Checking the project with the Readiness Check Tool

In the HW configuration of your STEP 7 V5.x


project, select the command "Station" "Export".
Siemens AG 2017 All rights reserved

Export your STEP 7 V5.x project as a .cfg file and


save it in a suitable location.

Open the Readiness Check Tool and open your


previously saved .cfg file via "Read in project from
HW-Config (STEP 7)".

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 8
2 Preconditions
2.3 Knowledge

You will receive the results of the check of your


project in the next step. This result you can now
save as PDF or Excel file.

2.3 Knowledge
You should also possess the following knowledge when implementing a
SINUMERIK project in regard to the migration to STEP 7 (TIA Portal):
Siemens AG 2017 All rights reserved

SIMATIC S7 programming
SIMATIC S7 programming in TIA Portal
SINUMERIK 840D sl start-up
Documentation "Getting Started SINUMERIK 840D sl SINUMERIK TIA Portal
Toolbox V1x"
Migrating STEP 7 programs (see Chapter 7 References)

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 9
3 Preparations in STEP 7 V5.x project
3.1 Symbols

3 Preparations in STEP 7 V5.x project


Preparatory programming
STEP 7 (TIA Portal) and the new generation of control units bring many
innovations in terms of operation and function. It therefore makes sense, in regard
to a migration to STEP 7 (TIA Portal), to observe these innovations during the
configuration of STEP 7 V5.x in advance.
This results in facilitating factors for a migration to STEP 7 (TIA Portal) and also for
a migration to S7-1500 in STEP 7 (TIA Portal).
In addition, the performance improvements of the S7-1500 generation can be
utilized by observing some of the rules. The techniques and behaviors described in
the following apply to the configuration of a SINUMERIK 840D sl with S7-300 in
STEP 7 V5.x just as in STEP 7 (TIA Portal).

3.1 Symbols
3.1.1 Absolute and symbolic programming

Absolute addressing
With absolute programming, the address (e.g. of the input E1.0) is specified
Siemens AG 2017 All rights reserved

directly. In this case, no symbol table is required. But the program is difficult to
read. Extensive projects thus lose a clear overview.

Symbolic addressing STEP 7 V5.x


With symbolic addressing, symbols (e.g. "Motor_On") are used instead of the
absolute addresses. The symbols for inputs, outputs, timers, counters, flags, and
blocks are saved in the table of symbols.

Symbolic addressing STEP 7 (TIA Portal)


In STEP 7 V5.x, you could assign a symbol to addresses using the symbol table
without the address itself needing to be contained in the project. In the TIA Portal,
there is no symbol table and all used objects have a symbolic name. Global
addresses are saved in STEP 7 (TIA Portal) in the variable table.
Furthermore, all UDT (STEP 7 (TIA Portal): PLC data types) have a symbolic
name. You must use the symbolic addressing for the declaration of instances.

3.1.2 Advantages of symbolic addressing

The use of meaningful symbols allows you to clearly and legibly display the
program code in your project.
This results in further advantages:
No long, all-encompassing comments are necessary
High-performance, error-free data access (STEP 7 (TIA Portal))
Optimized blocks are only addressed symbolically (S7-1500)
The use of absolute addresses can be dispensed with
Assignment monitoring by STEP 7

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 10
3 Preparations in STEP 7 V5.x project
3.1 Symbols

3.1.3 Integrated definition and use of symbols

To improve the legibility, assign meaningful names to your addresses, which you
either:
define as variables in databases, or
assign the memory addresses of the inputs and outputs, flags, timers and
counters in the symbol table
After entering in the LAD/FBD/STL/SCL editor, the associated symbol is
automatically displayed.

3.1.4 Address priority

With the "address priority" in the properties of the block folder, you can set whether
the symbol or the absolute value is to be authoritative after the change in the
symbol table when the block is opened.

Behaviors of the address priority after a change in the symbol table


Table 3-1: Address priority response
Address priority Change of the Instruction Effect
assignment "Symbol_A and
E0.1" opening
Symbol_A E0.2
Siemens AG 2017 All rights reserved

absolute U E0.1 In the instructions, the absolute


value E0.1 is displayed because
symbols are no longer assigned to
it.
symbolic Symbol_A E0.2 U Symbol_A The instruction is retained. A
message about the altered symbol
assignment is displayed.
absolute Symbol_B E0.1 U Symbol_B In the instruction, the new symbol
for the still valid absolute value
E0.1 is displayed.
symbolic Symbol_B E0.1 U Symbol_A The instruction is marked as
erroneous (red font), because
Symbol_A is no longer defined.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 11
3 Preparations in STEP 7 V5.x project
3.1 Symbols

Procedure: Setting the address priority in STEP 7 V5.x


Table 3-2: Setting the address priority

1. Right-click the block folder and then open the


"Object Properties" via the shortcut menu.
Siemens AG 2017 All rights reserved

2. In the dialog "Properties Block Folder


Offline", select the "Address priority" tab.

The four selection options have the following


meaning:
For the address priority "Absolute value", fully
qualified symbolic DB accesses are retained in
the code with the last saved name after a
change in the DB. This means that the symbol
retains its priority for completely symbolic
accesses in the code.

An actual parameter is assigned to the formal


parameter. In this way, both parameters
(actual and formal) have the same symbol.
The prerequisite is that the data type and
parameter type allow this.
This means that existing supplies of actual
values are not lost when the interface of a
block is expanded. STEP 7 remembers the
previous assignment.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 12
3 Preparations in STEP 7 V5.x project
3.1 Symbols

The following must be noted:


Before the switchover, close all of the blocks, because otherwise the address
priority will be reset to the original setting (before the blocks were opened)
when the blocks are saved.
If the address priority is set to "Absolute value" and you later changed
addresses in the symbol table, you should switch the address priority to
"symbolic" to activate these changes.
If the address priority is set to "Symbol" and you later changed addresses in
the symbol table, you should switch the address priority to "Absolute value" to
activate this change.
If you open a project which has not yet been opened using one of the versions
STEP 7 V5.2, the project is set to the previous procedure. If you want to use
the benefits of a newer version, change the settings to the desired version

Note You can continue to absolutely address all of the declarations in function blocks
with known addresses according to the SIMATIC rules. This data is displayed by
the system and is also saved in SIMATIC format in the memory of the CPU,
although this lead to reduced performance in newer S7-300 CPU modules,
because your processors cannot optimally access this SIMATIC data storage.
Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 13
3 Preparations in STEP 7 V5.x project
3.2 Blocks

3.2 Blocks
3.2.1 Naming of blocks

In TIA Portal, each block has a number and a name. It is therefore not necessary to
declare a symbolic name in STEP 7 (TIA Portal). If the migrated program contains
symbol declarations for blocks or UDTs, these will be used as names after the
migration. Therefore, it makes sense to give all of the blocks in STEP 7 V5.x
meaningful symbolic names.

3.2.2 Declaration of the block parameters

The following rules must be observed when using block parameters within a block:
Input parameters must only be read.
Output parameters must only be written.
In/out parameters may be read and written.

3.2.3 Blocks in the project


Siemens AG 2017 All rights reserved

In a STEP 7 (TIA Portal) project, all of the blocks containing data that is used must
be available. In STEP 7 V5.x, it was sufficient to only declare the blocks in the
symbol table if they were available online in the PLC Runtime.
You can move the necessary blocks, such as the axis and channel blocks, from the
SINUMERIK TIA Portal Toolbox library into the project after the migration in STEP
7 (TIA Portal). You import the names of the blocks with the default names, as
specified by SIEMENS. You can find more on the default names in Chapter
"Tabular block list" in the commissioning manual CNC: NC, PLC, drive for TIA (IDsl
TIA).
If you would like to assign your own names, you can change the names either in
STEP 7 (TIA Portal) or create them directly in STEP 7 V5.x. Create a DB for the
SINUMERIK blocks of the type UDT with the matching UDT (e.g. UDT31). To do
this, define the name you want as the symbol.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 14
3 Preparations in STEP 7 V5.x project
3.3 Programming

3.3 Programming
3.3.1 Fully qualified addressing

Fully qualified addressing with specification of the DB name is preferred over


partially qualified addressing with "AUF"/"OPN". Partially qualified addresses are
converted to fully qualified addresses as much as possible during the migration by
STEP 7 (TIA Portal). With regard to safety programming, the addressing should be
fully qualified to ensure that the right DB is opened.
To achieve the maximum performance of program processing on S7-1500 CPUs
and to achieve optimal compilation of the project in the event of changes, value
transfers between blocks are, in principle, only permitted via the block interfaces,
via global data blocks, or via PLC variables. More information on this can be found
in Chapter 3.5 Structure.
A value transfer via the register or status word is possible in STL (but not in LAD
and FBD) with some restrictions in S7-1500 CPUs. The program processing slows
down, however if you use these areas to transfer values between different blocks.

3.3.2 Use of the local data stack

Absolute addressing of the L stack is to be avoided. The reason for this is the
Siemens AG 2017 All rights reserved

increased risk of duplicate usage of a local data variable if additional temporary


variables are created.
It is also not possible to rely on the set local variable from FCxx retaining the same
value and, as a result, being able to be re-used in another project.
It must always be assumed that a project is expanded by another person and the L
stack area is unknowingly overwritten by this person using temporary variables.
Due to this risk, which can have unforeseeable consequences in the PLC program,
you should avoid using the local data stack directly.
The use of an FB with static variables instead of an FC with local data is regarded
as a safe solution. As a result, the variables are only saved for the FB in the
instance data block. By using your block as an FB, you can also ensure that your
FB can be universally used in all projects.
Another reason for selecting this procedure is that it will no longer be possible, with
regard to the S7-1500 to refer to local data in blocks (across areas) with optimized
access using the address register. Only symbolic access is possible for the
optimized blocks.
STEP 7 (TIA Portal) displays a warning when the local data stack is absolutely
addressed.

A frequently used example is the use of the local data stack when swapping bits in
a byte, as shown in the following code in Table 3-3: Swapping bits with local data
stack. An alternative with SCL is shown in Table 3-4: Swapping bits without local
data stack.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 15
3 Preparations in STEP 7 V5.x project
3.3 Programming

Table 3-3: Swapping bits with local data stack


Swapping bits with local data stack in STL
FUNCTION "EXCHANGE" : Void
TITLE = Swapping the bits 0 to 7 in a byte
{ S7_Optimized_Access := 'FALSE' }
AUTHOR :
FAMILY :
NAME : BITS_TAUSCH
VERSION : 1.0
VAR_INPUT
Input_byte_1 : Byte;
END_VAR

VAR_OUTPUT
Output_byte_1 : Byte;
END_VAR

VAR_TEMP
Buffer_Input_byte : Byte;
Buffer_Output_byte : Byte;
END_VAR

BEGIN
Siemens AG 2017 All rights reserved

NETWORK
TITLE = Swapping the bits 0 to 7 in a byte
L #Input_byte_1;
T #Buffer_Input;
U %L0.7;
= %L1.0;
U %L0.6;
= %L1.1;
U %L0.5;
= %L1.2;
U %L0.4;
= %L1.3;
U %L0.3;
= %L1.4;
U %L0.2;
= %L1.5;
U %L0.1;
= %L1.6;
U %L0.0;
= %L1.7;
L #Buffer_Output;
T #Output_byte_1;
NETWORK
TITLE = block end
BE;

END_FUNCTION

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 16
3 Preparations in STEP 7 V5.x project
3.3 Programming

Table 3-4: Swapping bits without local data stack


Swapping bits without local data stack in SCL
FUNCTION "REVERSE" : Void
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
VAR_INPUT
Input_byte_1 : Byte;
END_VAR

VAR_OUTPUT
Output_byte_1 : Byte;
END_VAR

BEGIN
#Output_byte_1 := SHL(IN := #Input_byte_1, N := 7)
OR SHR(IN := #Input_byte_1 , N := 7 )
OR (ROR(IN := #Input_byte1, N := 3) AND 2#01000100)
OR (ROL(IN := #Input_byte1, N := 3) AND 2#00100010)
OR (SHL(IN := #Input_byte1, N := 1) AND 2#00010000)
OR (SHR(IN := #Input_byte1, N := 1) AND 2#00001000);
END_FUNCTION
Siemens AG 2017 All rights reserved

3.3.3 Data type conversion

Table 3-5: Type check differences


STEP 7 V5.x without check STEP 7 (TIA Portal) with IEC compliance
check

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 17
3 Preparations in STEP 7 V5.x project
3.3 Programming

If you link several addresses in an instruction, you must observe the compatibility
of your data types. This also applies to assignments or when supplying block
parameters. In STEP 7 V5.x, it is possible to convert incompatible data types and
to load them into the controller without a check. STEP 7 (TIA Portal) uses a stricter
IEC check (Table 3-5: Type check differences). Conversions take place there
according to the following rules:
Implicit conversion
Implicit conversion is supported by the programming languages LAD, FBD,
SCL, and GRAPH. Implicit conversion is not possible in the programming
language STL:
The bit length of the source data type must not exceed the bit length of the
destination data type.
Explicit conversion
You use an explicit conversion instruction before the actual instruction is
carried out:
A possible overflow is displayed in the enable output ENO.

Note
Converting of bit sequences in SCL
In expressions, all bit sequences (BYTE, WORD, DWORD and LWORD) are
treated like the corresponding integers without signs (USINT, UINT, UDINT and
Siemens AG 2017 All rights reserved

ULINT). Therefore, for example, the implicit conversion of DWORD to REAL is


carried out like a conversion from UDINT to REAL.

3.3.4 Initial deletion in OB100

Configurations in which blocks on the NC are deleted in OB100 at the start of the
program should be avoided at all costs (Fig. 3-1: Should be avoided: delete data
block in OB100). This leads to all of the missing blocks in the NC being reloaded.
In STEP 7 (TIA Portal), the blocks would then be differentiated and designated as
offline/online and the project would thus no longer be consistent.
Also to be avoided are configurations in which user areas in created FBs are
deleted in OB100 after FB2 is called (Fig. 3-2: Should be avoided: delete user area
after calling FB2).

Fig. 3-1: Should be avoided: delete data block in OB100

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 18
3 Preparations in STEP 7 V5.x project
3.3 Programming

Fig. 3-2: Should be avoided: delete user area after calling FB2

3.3.5 Evaluation of the enable output ENO

If possible, try to avoid an evaluation of ENO when programming your S7-300. With
S7-1500 it is possible to disable the generation of ENO (Table 3-6: Effect of ENO
states). This saves testing during runtime.

Table 3-6: Effect of ENO states


State in Effect Example
S7-1500
ENO The following instructions are
enabled executed depending on the 1
1 instruction result.
ENO The following instructions are
Siemens AG 2017 All rights reserved

disabled always executed.


2
2 Advantage: faster execution,
due to fewer checks.

3.3.6 Working with Struct of Bool

In many cases, a "Struct" with several "Bools" is created, mostly with a size of one
byte or word (8 or 16 bits). The background of a "Struct" is mostly the capability of
assigning each bit its own name. Often, however, byte addressing is also applied to
a "Struct of Bool" (8 bits) for this "Struct" (or the other way around: bit addressing
for a byte). STEP 7 (TIA Portal) will display warnings in this case: "The address is
not occupied by a variable.". With the aid of the "BLKMOV" instruction, you can
copy specific data areas without a warning being displayed.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 19
3 Preparations in STEP 7 V5.x project
3.3 Programming

Table 3-7: Example of Struct addressing absolutely addressed


Writing to a byte in the Struct absolutely addressed
Data block with the Struct: Function block:

DATA_BLOCK "Data_Block_1" FUNCTION_BLOCK "Block_1"


{ S7_Optimized_Access := 'FALSE' } { S7_Optimized_Access := 'FALSE' }
VERSION : 0.1 VERSION : 0.1
STRUCT
Data_1 : Struct BEGIN
Databit_1_1 : Bool; NETWORK
Databit_1_2 : Bool; TITLE = Load 0 in a Byte (Struct of 8 Bool)
Databit_1_3 : Bool;
Databit_1_4 : Bool; SET;
Databit_2_1 : Bool; L 0;
Databit_2_2 : Bool; T %DB6688.DBB0; //Data_Block_1
Databit_2_3 : Bool;
Databit_2_4 : Bool; END_FUNCTION_BLOCK
END_STRUCT;
END_STRUCT; This procedure causes a warning in STEP 7 (TIA
Portal)!
BEGIN

END_DATA_BLOCK
Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 20
3 Preparations in STEP 7 V5.x project
3.3 Programming

Table 3-8: Example of Struct addressing via Blockmove


Writing to a byte in the Struct with Blockmove
Data block with the Struct: Function block:

DATA_BLOCK "Data_Block_1" FUNCTION_BLOCK "Block_1"


{ S7_Optimized_Access := 'FALSE' } { S7_Optimized_Access := 'FALSE' }
VERSION : 0.1 VERSION : 0.1
STRUCT VAR_OUTPUT
Data_1 : Struct Error code: Int;
Databit_1_1 : Bool; END_VAR
Databit_1_2 : Bool;
Databit_1_3 : Bool; VAR
Databit_1_4 : Bool; Temp_Byte { S7_HMI_Visible := 'False'} : Byte;
Databit_2_1 : Bool; END_VAR
Databit_2_2 : Bool;
Databit_2_3 : Bool; BEGIN
Databit_2_4 : Bool; NETWORK
END_STRUCT; TITLE = Load 0 in a Byte (Struct of 8 Bool)
END_STRUCT; SET;
L 0;
BEGIN T "Cache_DB".Temp_Byte;

END_DATA_BLOCK
Siemens AG 2017 All rights reserved

Buffer DB: CALL BLKMOV


{blk_type := 'Any'}
( SRCBLK := P#DB6689.DBX0.0 BYTE 1 , //Cache_DB
DATA_BLOCK "Cache_DB"
RET_VAL := #Errorcode ,
{ S7_Optimized_Access := 'FALSE' }
DSTBLK := P#DB6688.DBX0.0 BYTE 1 //Data_Block_1
VERSION : 0.1
);
STRUCT
Temp_Byte : Byte;
END_FUNCTION_BLOCK
END_STRUCT;

BEGIN This procedure runs in STEP 7 (TIA Portal) without a


warning.
END_DATA_BLOCK

Note You can find more information on the BLKMOV function in the respective online
help of STEP 7 V5.x and STEP 7 (TIA Portal).

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 21
3 Preparations in STEP 7 V5.x project
3.4 Configuration

3.4 Configuration
3.4.1 General information

An orderly and structured configuration of the STEP 7 V5.x project is essential for a
migration to STEP 7 (TIA Portal). Keep your project as current as possible. Blocks
from STEP 5 are to be avoided.

3.4.2 Consistency check

In STEP 7 V5.x, you must check your project for consistency, this is done by
means of the consistency check. The consistency check is a prerequisite to be able
to migrate this project to STEP 7 (TIA Portal). An inconsistent project cannot be
migrated.
Table 3-9: Executing the consistency check in STEP 7 V5.x

Right-click the folder "Blocks" and select the


command "Check Block Consistency".
Siemens AG 2017 All rights reserved

Check the folder hierarchy 1


and the info box 2
for inconsistencies or information and
process this in your project, if applicable.
1

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 22
3 Preparations in STEP 7 V5.x project
3.4 Configuration

In the help, under "Buttons in the Tree


View" and under "Buttons in the Output
Window", you will find a help for the
displayed object hierarchy and the info box.
Siemens AG 2017 All rights reserved

Then click on "Compile All" to compile all


blocks in the project. After the compilation,
check the info box for error messages and
clear the errors. Repeat this procedure until
no more errors are displayed in the info
box.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 23
3 Preparations in STEP 7 V5.x project
3.5 Structure

3.4.3 Hardware

Ensure that you use hardware with firmware V4.5 SP2 for the configuration. Also,
you must ensure that you do not use any I/O modules which have been
discontinued as of October 1, 2007, because such hardware is not supported by
STEP 7 (TIA Portal).

3.5 Structure
Try to keep your project as structured as possible. A well-structured project has the
following advantages:
Functions can be comprehended more easily and more quickly.
Others can find their way around in the project more quickly.
Faster and simpler troubleshooting.
Compilation of changes is processed more quickly.

3.5.1 Nesting depth

Observe your nesting depth in your program. The deeper your nesting depth in a
block or a network, the less manageable the function and the more difficult it is to
Siemens AG 2017 All rights reserved

read. If possible, begin instead a new network with a meaningful comment or


create a new block.

3.5.2 Interface variables possible instead of global variables

Use local variables as much as possible. This allows the blocks to be used
universally and modularly.
Use the exchange of data via the block interfaces (In, Out, InOut) to ensure the
re-usability of the blocks.
Use instance data blocks as local memory for the respective function block.
Other blocks should not write to instance data blocks (Fig. 3-3: Avoiding
access to instance data blocks).

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 24
3 Preparations in STEP 7 V5.x project
3.5 Structure

Fig. 3-3: Avoiding access to instance data blocks

Note If only the interfaces of the blocks are used for data exchange, it is ensured that
all of the blocks can be used independently of one another.
Siemens AG 2017 All rights reserved

Fig. 3-4: Block interfaces for data exchange

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 25
3 Preparations in STEP 7 V5.x project
3.5 Structure

3.5.3 Global data blocks instead of flags

Optimized global DBs of a PLC 1500 are significantly more powerful than the flag
area, which is not optimized due to compatibility reasons.
Working with flags (including system and cycle flags) is problematic, because each
controller has a differently sized flag area.
Therefore, do not use flags for programming. Instead, always use global data
blocks and IEC counters and timers (Fig. 3-5: IEC Timer in STEP 7 (TIA Portal)) in
connection with multi-instances instead of cycle flags. Thus, the program remains
universally usable and you ensure that your blocks can be used on all controllers
problem-free and without any further adaptations.

Fig. 3-5: IEC Timer in STEP 7 (TIA Portal)


Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 26
4 STEP 7 (TIA Portal)
4.1 New features

4 STEP 7 (TIA Portal)


4.1 New features
The most important new features of STEP 7 (TIA Portal) are described below. The
list only represents some of the new functions with a basic description. Detailed
descriptions of functions can be found in the TIA Portal documentation.

4.1.1 Inspector window

The inspector window (Fig. 4-1: Inspector window) is one of the most important
elements in STEP 7 (TIA Portal); additional information on a selected object or on
executed actions is displayed.

1 2 3

Fig. 4-1: Inspector window

4
Siemens AG 2017 All rights reserved

1 "Properties" tab
2 "Info" tab
3 "Diagnostics" tab
4 Area navigation in the "Properties" tab
5 Content of the "Properties" tab

"Properties" tab
This tab displays the properties of the selected object. You can change editable
properties here.

"Info" tab
This tab displays additional information on the object selected, as well as alarms on
the actions executed (such as compiling).

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 27
4 STEP 7 (TIA Portal)
4.1 New features

"Diagnostics" tab
This tab provides information on system diagnostics events, configured alarm
events, and connection diagnostics.

Navigation within the tabs


You can use area navigation and the lower-level tabs to display the information you
require within the tabs.

4.1.2 Library

You store objects that you want to reuse in the libraries. For each project, there is a
project library that is integrated into the project. In addition to the project library,
you can create any number of global libraries, which can be used across projects.
The libraries are mutually compatible, which means that you can copy and move
library elements between the libraries. With the aid of libraries you create, for
example, templates for blocks, which you first insert into the project library and
further develop them there. Lastly, you copy the blocks from the project library to a
global library. You provide the global libraries to other employees in your project.
They use the blocks further and adapt them to their personal requirements, if
applicable.
Both the project library and global libraries distinguish between two different types
of objects:
Siemens AG 2017 All rights reserved

Copy templates
Almost any object can be saved as copy template and re-inserted into the
project later. You can, for example, save entire devices with their contents or
cover sheets as copy templates for the system documentation.

Types
Elements which are necessary for the execution of user programs, e.g. blocks,
PLC data types, HMI user data types or image blocks, are suitable as types.
Types can be versioned and support professional further development.
Projects in which the types are used can be updated once new versions of the
types are available.

More on libraries can be found in the system manual "STEP 7 Professional V1x".

4.1.3 Version management

With the aid of the version management of types, you have the capability of
centrally developing types and rolling out the latest version to the individual
projects as updates. In this way, error corrections and function expansions can be
easily integrated into existing projects. If you have created a new version of a
global library, you update existing projects in an automatic process.
As a result, errors are minimized and the effort for maintaining large automation
solutions with many individual projects is reduced. More on version management
and its handling can be found in the system manual "STEP 7 Professional V1x".

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 28
4 STEP 7 (TIA Portal)
4.1 New features

4.1.4 Folder structure

In STEP 7 (TIA Portal), it is possible to create different groups in the project and to
thus sort your blocks. You can create further folders in the "Program blocks" folder
via the shortcut menu. With the aid of these so-called "Groups" you can design
your project in a more manageable way.
Simply move your blocks into the created groups using drag & drop. One option for
sorting would be to first divide the blocks into basic program blocks and user
program blocks. In the two existing groups, you can then further differentiate
between the different block types. (Fig. 4-2: Example of sorting the program
blocks).

Fig. 4-2: Example of sorting the program blocks


Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 29
4 STEP 7 (TIA Portal)
4.2 Configuration

4.2 Configuration
4.2.1 Addressing of the machine control panel

To keep the project in STEP 7 (TIA Portal) consistent, it is advisable to include the
machine control panel in the hardware configuration.

Requirement
The current version of the general station description (GSD/GSDML) files to be
installed is stored on your PG/PC.

Installing GSD/GSDML files


Download the required GSD file(s) from the following support page:
https://support.industry.siemens.com/cs/ww/de/view/62332440

To add SINUMERIK I/O via device description files, proceed as follows:


1. In the "Options" menu, select the "Install device master data files" command.
2. In the "Install general station description files" dialog, select the folder that
contains the GSD/GSDML files.
3. Select one or more files from the "Content of the imported path" list and
Siemens AG 2017 All rights reserved

confirm with "Install".

Fig. 4-3: Installing a GSDML file

ATTENTION The installation of GSD/GSDML files cannot be undone!

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 30
4 STEP 7 (TIA Portal)
4.2 Configuration

Integration of the machine control panels


Use drag & drop to move the required machine control panel into your project and
equip it with the associated modules. Enter the address areas you use in the
modules.

Fig. 4-4: Example of integration of a PROFIBUS MSST with standard+handwheel

Fig. 4-5: Example of integration of a PROFINET MSST


Siemens AG 2017 All rights reserved

Parameters on FB1 in OB100


If you do not create your machine control panel in your project, you must change
the parameters of FB1 in OB100 from pointers to DB variable addresses to keep
your project warning-free. To do this, create an MCP-DB with the input/output
image used for your machine control panel. The tables with the input/output images
can be found in the manual "SINUMERIK 840D sl operator components machine
control panels".
Also declare the "Status DW for sending MCP 1" and the "Status DW for receiving
MCP 1".

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 31
4 STEP 7 (TIA Portal)
4.2 Configuration

Fig. 4-6: Table for the input image for the MCP 483C PN

Fig. 4-7: Conversion of the input image of the MCP 483C PN


Siemens AG 2017 All rights reserved

Fig. 4-8: Converted input and output image in the DB for MCP 483C PN

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 32
4 STEP 7 (TIA Portal)
4.2 Configuration

Fig. 4-9: Example of parameter assignment on FB1


Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 33
5 Comparison of SINUMERIK Toolbox and SINUMERIK TIA Portal Toolbox
5.1 Overview

5 Comparison of SINUMERIK Toolbox and


SINUMERIK TIA Portal Toolbox
5.1 Overview
The SINUMERIK TIA Portal Toolbox differs from the STEP 7 V5.x SINUMERIK
Toolbox in terms of layout and certain functions. In contrast to the SINUMERIK
Toolbox "library", the SINUMERIK TIA Portal Toolbox library is not a project, but a
genuine library.
The SINUMERIK TIA Portal Toolbox library contains various copy templates, which
can be used to easily and quickly make a selection of pre-selected blocks, in
addition to the individual selection.

5.2 Comparison of functions

Table 5-1: SINUMERIK Toolbox comparison


Function SINUMERIK 840D sl Toolbox SINUMERIK 840D sl TIA Portal
for STEP 7 V5.x Toolbox V1x
Siemens AG 2017 All rights reserved

SINUMERIK Extended functionality and changed


Adding the PLC basic handling
program The SINUMERIK Toolbox for The SINUMERIK TIA Portal Toolbox
STEP 7 V5.x contains a library with contains various copy templates with
the PLC basic program as project for basic program blocks for each firmware
this specific firmware version. version.
Some data blocks are not contained The copy templates also contain data
in this library, but rather they are blocks of the axes/spindles and DB2
created at runtime on the controller alarms that differ from the toolbox for
(e.g. axis DB). STEP 7 V5.x. Although this permits a
simple symbolic addressing of the
blocks,
you should add only those blocks that
you require in your program.
Defining user-defined Changed handling
data types (UDT)
In STEP 7 V5.x you can create user- In the TIA Portal you can create user-
defined data types (UDT) and store defined structured data types (UDT) in
them in the "Blocks" folder. the special "PLC data types" folder.
The user data blocks from the basic The user data blocks from the basic
program (e.g. axis DB) provided by program are not based on UDT, but
SIEMENS are also based on UDT. rather they are global DBs.
Symbolic names have been declared These data blocks are supplied as
for these UDTs in the symbol table copy templates and can be added to
without the associated blocks (CPU the project so they can be addressed
DBs) being contained in the project. symbolically.

Addressing elements Changed handling


symbolically
In STEP 7 V5.x, you could address In the TIA Portal, however, symbolic
addresses (I/O signals, flags, addressing has priority which increases
counters, times, DBs, FBs) either the readability of the program and so

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 34
5 Comparison of SINUMERIK Toolbox and SINUMERIK TIA Portal Toolbox
5.2 Comparison of functions

Function SINUMERIK 840D sl Toolbox SINUMERIK 840D sl TIA Portal


for STEP 7 V5.x Toolbox V1x
absolutely or symbolically, although simplifies error correction.
absolute addressing had priority as
default.
In STEP 7 V5.x, you could assign a In the TIA Portal, there is no symbol
symbol to addresses (I/O signals, table and all used objects have a
flags, counters, times, DBs, FBs) symbolic name.
using the symbol table without the
address itself needing to be contained
in the project.
Generating and Simplified operation
loading PLC symbols
The external tool "PLC Symbol You can export the PLC symbols
Generator" can be used to export directly via the shortcut menu of the
PLC symbols for SINUMERIK folder PLC variables in the TIA Portal.
Operate.
Organizing objects in Extended functionality
libraries
You can organize parts of your Libraries in the TIA Portal can contain
program into libraries so, for example, additional hardware components.
they can be added to other programs.
Configuring Simplified operation
Siemens AG 2017 All rights reserved

connections
In STEP 7 V5.x, you open NetPro to In the TIA Portal, you can edit
edit connections. connections in the net view under
"Connections".
Creating SINUMERIK Extended functionality
archives
In STEP 7 V5.x, you can create In addition to the SINUMERIK PLC
SINUMERIK PLC hardware upgrade archives known from STEP 7 V5.x, you
archives and PLC commissioning can now create PLC reload archives in
archives to obtain precompiled data which a selection of program blocks is
for use with SINUMERIK Operate. saved.
Accessing Changed handling
PLC
machine data In STEP 7 V5.x, you can use absolute In the TIA Portal, you can symbolically
symbolically addressing to access elements of the directly access block elements of the
DB20 (interface for PLC machine DB20 and so access the PLC machine
data). You can use the symbol table data when you add and declare the
to symbolically address the DB20. DB20 in the project.
The DB20 is created at runtime on the
controller.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 35
6 Configuration recommendation (step by step)
5.2 Comparison of functions

6 Configuration recommendation (step by


step)

Requirements:
STEP 7 V5.5 SP2 HF4 (or later) and STEP 7 (TIA Portal) are installed on the
PG/PC.
Or the project has been converted to the format .amxx with the migration tool
(see the information system of the TIA Portal, keyword "Migration tool").
All option packages used to create the project in STEP 7 V5.x are installed and
licensed (e.g. the option package for SCL);
specific information concerning the migration of other option packages is
contained in the associated documentation.
Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 36
6 Configuration recommendation (step by step)
5.2 Comparison of functions

Migration procedure
The procedure is divided into different sections (Fig. 6-1: Migration steps, which
can all be processed in succession.

Fig. 6-1: Migration steps


STEP 7 V5.x

Start

Check hardware
and components
with Readyness
Check Tool

Result Not ok Adjust hardware

Ok

Check block
consistency
Siemens AG 2017 All rights reserved

Rectify
inconsistency,
Result Not ok
create user data
block

Ok

Migrate project

correct
in V5.x

Follow up
Result Not ok information in
migrate log

Ok
correction way

Insert basic program


data block if
necessary and
compile project

Follow up
Result Not ok information in
compile log

Ok

End

STEP 7 (TIA Portal) V1x

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 37
6 Configuration recommendation (step by step)
5.2 Comparison of functions

STEP 7 V5.x
1. Check the hardware components with the Readiness Check Tool (reference
date Oct. 1, 2007).
2. Bring the project to be migrated to SINUMERIK 840D sl Toolbox 4.5 SP2 (or
higher) for STEP 7 V5.5 SP2 HF4 (or higher).
3. You can migrate projects with protected blocks in the TIA Portal.

Note Nevertheless, remove the block protection beforehand:

because another block protection exists in STEP 7 (TIA Portal)


(otherwise, the migrated block is marked as unsupported and you can
no longer open and edit the block)

because you compile the protected blocks by checking the block


consistency and can clear any time stamp conflicts (see Para. 4)

4. Check the block consistency:


(more information on this under
https://support.industry.siemens.com/cs/de/de/view/5416540)
Check the block consistency log (delete any blocks that are no longer
used, create missing blocks, delete FC1007/FC1008/FC1010).
Siemens AG 2017 All rights reserved

Creating user data blocks from the PLC basic program.

Note Save your user data blocks from the basic program in your project beforehand.
To do this, create a DB of the type with the associated UDT (e.g. UDT 31 for
Axis 1). You can use your own names or the names from the TIA Portal system
library as a symbolic name.
These can also be added after the migration from the SINUMERIK TIA Portal
Toolbox library with the default names. You can then keep the default name or
rename the blocks.
(See Chapter 3.2.3 Blocks in the project)

ATTENTION If you use your own names for the user data blocks from the basic
program, you must observe the following in STEP 7 (TIA Portal) when
updating or copying blocks:
After you have copied SINUMERIK basic program blocks into the project,
you must always delete your blocks (with user-defined names) and assign
your user-defined names to the newly copied blocks.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 38
6 Configuration recommendation (step by step)
5.2 Comparison of functions

Add SCL sources if not included.


Checking the user program for absolute address without symbol and data
type.
Checking the user program for implicit type conversion.
Check the block consistency via "Compile all" and eliminate errors.

Examples:
An 8-byte Date_And_Time is copied in two halves of 4 bytes each instead of
using Blockmove.
Scratch flags are used with various types; better to clean up beforehand.

STEP 7 (TIA Portal) V1x (NCU with S7-300)


1. Migrate the project in STEP 7 (TIA Portal) with/without hardware (more
information on this in the Getting Started SINUMERIK TIA Portal Toolbox).
Check the migration log.
Drag the "MigrateProject" copy template into the project.
If applicable, insert basic program blocks from the library.
Siemens AG 2017 All rights reserved

Set the safety mode in the HW-Config.


Compile the project (compete).
Do not immediately begin with the follow-up work in STEP 7 (TIA Portal).
Instead, first identify the problems and eliminate them in STEP 7 V5.x
before you put effort into the follow-up work of the STEP 7 (TIA Portal)
project.

Note During the migration, it may happen that some networks cannot be displayed in
LAD or FBD. STEP 7 (TIA Portal) then converts the networks to STL.
The causes for this are often stricter type checks or missing implicit type
conversions.
This problem can be avoided through corresponding preliminary work in Classic,
but not during the migration.
The issues to be resolved may be difficult to find in STEP 7 V5.x. After the
migration, you can see in the inspection window which networks were not
imported in the original language. This allows you to search in the STEP 7 V5.x
project in a targeted manner, resolve the issue, and perform another migration.

Clear errors and warnings in the PLC program (see history of messages in
the inspection window after the compilation).

Once you have cleared all the errors and warnings, the migration is finished.

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 39
7 References
5.2 Comparison of functions

7 References
Table 7-1
Topic Title
\1\ Siemens Industry http://support.industry.siemens.com
Online Support
\2\ Download page of https://support.industry.siemens.com/cs/ww/de/view/109478721
the entry
\3\ Programming https://support.industry.siemens.com/cs/ww/en/view/81318674
style guide for S7-
1200/S7-1500
\4\ Programming http://support.automation.siemens.com/WW/view/en/81318674
guideline for S7-
1200/S7-1500
\5\ STEP 7 https://support.industry.siemens.com/cs/ww/en/view/1097471
Professional 36
V14SP1
\6\ SIMATIC S7-1200 https://support.industry.siemens.com/cs/ww/de/view/86630375
/ S7-1500
comparison list for
programming
languages
\7\ SINUMERIK https://support.industry.siemens.com/cs/ww/en/view/74607149
Siemens AG 2017 All rights reserved

840D sl operator
components
machine control
panels
\8\ Collection of https://support.industry.siemens.com/cs/document/56314851
relevant entries
for migration
\9\ Prerequisites for https://support.industry.siemens.com/cs/document/62100731
migration

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 40
8 Contact

8 Contact
Siemens AG
Digital Factory
Motion Control
SINUMERIK Support
DF MC MTS PPM
Frauenauracher Strasse 80
91056 Erlangen
Germany

9 History
Table 9-1
Version Date Revision
V1.0 06/2017 First edition
Siemens AG 2017 All rights reserved

Programming recommendation for PLC S7-300


Entry ID: 109478721, V1.0, 06/2017 41

You might also like