Professional Documents
Culture Documents
positioning axes of an
S7-1200 as IO device
centrally from an
IO controller
Siemens
SIMATIC S7-1200 / S7-1500 Industry
Online
https://support.industry.siemens.com/cs/ww/en/view/109768880 Support
Legal information
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG ("Siemens"). They are
non-binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
© Siemens 2019 All rights reserved
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with Industrial Security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Table of contents
Legal information ......................................................................................................... 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Mode of operation ................................................................................ 4
1.3 Components used ................................................................................ 5
2 Engineering ........................................................................................................ 6
2.1 Hardware setup .................................................................................... 6
2.2 Description of interface......................................................................... 7
2.2.1 FB "LPTO_Control" .............................................................................. 7
2.2.2 FB "LPTO_DeviceStates"..................................................................... 9
2.2.3 FC "LPTO_Copy" ................................................................................. 9
2.3 Project integration .............................................................................. 11
2.3.1 Hardware configuration ...................................................................... 11
2.3.2 Library elements for the IO controller ................................................. 12
2.3.3 IO addressing ..................................................................................... 13
2.3.4 Project planning of the IO controller ................................................... 14
2.3.5 Configuring the positioning axes ........................................................ 17
2.3.6 Setting parameters ............................................................................. 23
2.3.7 Programming motion control instructions ........................................... 24
2.3.8 Commissioning ................................................................................... 26
2.4 Operation ............................................................................................ 28
© Siemens AG 2019 All rights reserved
3 Appendix .......................................................................................................... 29
3.1 Service and support ........................................................................... 29
3.2 Links and literature ............................................................................. 30
3.3 Change documentation ...................................................................... 30
1 Introduction
1.1 Overview
The "LPTO" library enables you to control up to 4 positioning axes of a S7-1200 as
an IO device centrally from an IO controller (S7-1200 or S7-1500). By means of a
pre-configured device CPU, you can rapidly put the remote axes into operation. In
the device CPU, 4 "TO_PositioningAxis" technology objects are configured, which
use the S7-1200’s 4 pulse generators to control 4 servo motors via a train of
pulses, PTO (PulseTrainOut). Using the I-device communication, you can move
and monitor the remote axes from the controller. This means that you can, for
example, use 8 pulse generators (4 local and 4 remote) with an S7-1200 as an
IO controller to centrally actuate 8 servo drives.
IO controller IO device
I-device
communication:
© Siemens AG 2019 All rights reserved
control
PROFINET / IE
feedback
PTO
2 Engineering
2.1 Hardware setup
The following figure shows the hardware structure of the application example.
Figure 2-1
Controller Device
L+ M S7-1200 L+ M L+ M S7-1200
CSM1277
P1 P1 P3 P1
P2
PTO
PROFINET IE
PG / PC
© Siemens AG 2019 All rights reserved
The periphery of the device CPU 1214C for connecting the PTO servo drives is
pre-defined as follows:
Table 2-1
Signal Axis 1 Axis 2 Axis 3 Axis 4
Pulse output Q0.0 Q0.1 Q0.2 Q0.3
Direction output Q0.4 Q0.5 Q0.6 Q0.7
Input low limit switch * I0.0 I0.3 I0.6 I1.1
Input homing switch I0.1 I0.4 I0.7 I1.2
Input high limit switch * I0.2 I0.5 I1.0 I1.3
* The hardware limit switches are pre-configured as normally open for simple
testing. In a real-life design, you should re-configure these as normally closed for
detection of an open circuit!
In the pre-configuration there is neither an output for drive enabling, nor an input
for the drive’s ready-state feedback.
Enabling is controlled by software through the technology object ("MC_Power"
instruction). Thus, you must hold the enable input of your servo drive as continually
triggered.
You can find additional wiring information in your servo drive’s description.
NOTE Only the DC/DC/DC variants of the CPU S7-1200 have integrated outputs for
direct control of drives (via PTO). With the signal interconnection from Table 2-1
the device CPU must be at least a CPU 1214C DC/DC/DC.
The FB "LPTO_Control" controls the "axis" device axis using the control data,
"control", which is received from the controller, and defines the feedback data
"feedback" of the axis for sending back to the controller. It is called in the cyclic OB
"Main" of the device CPU for each positioning axis. Configuration of the FB
"LPTO_Control" is part of the master copy "LPTO_DevicePlc" of the "LPTO"
library.
tasks ("moveAbsolute").
constantVelocity Bool TRUE = The axis travels at constant velocity.
(corresponds to the output "InVelocity" of the instruction
"MC_MoveVelocity" or "MC_MoveJog")
done Array[2..6] TRUE = The instruction was successfully executed.
of Bool ➔ see Table 2-5
busy Array[1..8] TRUE = The instruction is being executed.
of Bool ➔ see Table 2-5
aborted Array[3..8] TRUE = The instruction was aborted.
of Bool ➔ see Table 2-5
error Array[1..8] TRUE = An error occurred while the instruction was being processed
of Bool (see Table 2-5). The cause of the error can be found in parameters
"errorId" and "errorInfo".
statusId UInt Errors "error" occurred during instruction: 1=MC_Power, 2=MC_Reset,
3=MC_Home, 4=MC_Halt, 5=MC_MoveAbsolute,
6=MC_MoveRelative, 7=MC_MoveVelocity, 8=MC_MoveJog
errorId Word Error ID for parameter "error" of instruction "statusId"
errorInfo Word Error info ID for parameter "errorId"
NOTE You can find a List of ErrorIDs and ErrorInfos (technology objects as of V6) in the
Function Manual "SIMATIC STEP 7 S7-1200 Motion Control V6.0 in TIA Portal
V15" (\3\).
Table 2-5
Arrayelement Instruction done busy aborted error
1 MC_Power x x
2 MC_Reset x x x
3 MC_Home x x x x
4 MC_Halt x x x x
5 MC_MoveAbsolute x x x x
6 MC_MoveRelative x x x x
7 MC_MoveVelocity x x x
8 MC_MoveJog x x x
2.2.2 FB "LPTO_DeviceStates"
2.2.3 FC "LPTO_Copy"
Table 2-9
No. Instruction
1. Open an existing TIA Portal project with an S7-1200 in network view.
2. Open the "LPTO" library and integrate the CPU "LPTO_DevicePlc" into your
existing TIA Portal project by dragging and dropping from the master copies
© Siemens AG 2019 All rights reserved
("Device" folder).
The CPU "LPTO_DevicePlc" contains all necessary elements to carry out the
functions.
No. Instruction
3. Assign the existing S7-1200 to the CPU "LPTO_DevicePlc" as a controller.
Table 2-10
No. Instruction
1. By dragging and dropping from the library "LPTO" under "Types", copy the blocks
from the "Controller" folder into the program blocks of the controller CPU. Likewise
copy the data block "LPTO_Data" from the master copies ("Controller" folder) into
the program blocks and the
© Siemens AG 2019 All rights reserved
tag table "LPTO_TagTable" into the PLC tags of the controller CPU.
2.3.3 IO addressing
Table 2-11
No. Instruction
1. Open the tag table "LPTO_Tag_Table".
2. No addresses have been assigned to the tags yet.
Through the assignment of the IO controller, the transfer address area of the
I-device communication of the CPU "LPTO_DevicePlc" is created in the controller CPU.
© Siemens AG 2019 All rights reserved
3. Enter the start address of the corresponding transfer area as the address of the
respective tags from the tag table.
To do this, detach ("float") the tag table using the icon to avoid losing the focus on
the address overview in the inspector window.
Insofar as the move orders are transmitted via the I-device communication, the
controller CPU controls the positioning axes of the device CPU. Once the
connection between controller and device is interrupted, the axes stop because the
enable bit (Enable) is no longer transmitted. So that the axes cannot run away in
uncontrolled fashion once the connection is re-established, the enable bit must
also be reset on the controller side when the connection is interrupted.
Table 2-12
No. Instruction
1. Open the cyclic OB "Main" of the controller CPU.
2. Copy the FB "LPTO_DeviceStates" into Network 2 of the OB "Main".
© Siemens AG 2019 All rights reserved
No. Instruction
4. Highlight the PROFINET interface of the CPU "LPTO_DevicePlc" in the network
view.
Find the device number "deviceNumber" in the inspection window under "General >
Operating mode".
© Siemens AG 2019 All rights reserved
5. Enter the values you have found at the input parameters of the FB
"LPTO_DeviceStates".
No. Instruction
6. Copy the FC "LPTO_Copy" into Network 3 of the OB "Main".
7. Enter the periphery addresses and the data of the DB "LPTO_Data" for axis 1 at the
interfaces of the FC "LPTO_Copy" (see tag table "LPTO_TagTable").
© Siemens AG 2019 All rights reserved
8. Repeat steps 6 and 7 for the necessary device axes (2 to a maximum of 4).
A device axis is configured in exactly the same way as a local positioning axis.
Table 2-13
No. Instruction
1. Open the configuration of the technology object "Pulse1" of the Device CPU
"LPTO_DevicePlc".
© Siemens AG 2019 All rights reserved
No. Instruction
3. Basic parameters – Drive:
Here you can change the signal type, deactivate the direction output, and define
enabling and feedback for the drive.
© Siemens AG 2019 All rights reserved
No. Instruction
5. Extended parameters – Position limits:
Enter the select level for the hardware limit switch here.
Indicate the positions for detection of the software limit switch.
You can also disable the hardware and software limit switches.
The hardware limit switches are pre-configured as normally open for simple testing.
In a real-life design, you should re-configure these as normally closed for detection
© Siemens AG 2019 All rights reserved
No. Instruction
6. Dynamics – General:
Enter the velocity limits as well as acceleration and deceleration here. Enter the jerk
and smoothing time for jerk limiting. You can also disable the jerk limit.
© Siemens AG 2019 All rights reserved
No. Instruction
7. Dynamics – Emergency stop:
Indicate the emergency deceleration and emergency stop ramp-down time here.
© Siemens AG 2019 All rights reserved
8. Homing – Active:
Indicate here the select level, the approach/homing direction and the side of homing
switch here. Indicate the approach velocity and homing velocity. You can deactivate
the auto reverse at HW limit switch, and indicate a home position offset.
No. Instruction
9. Homing – Passive:
Indicate the select level and the side of homing switch here.
© Siemens AG 2019 All rights reserved
10. Repeat the configuration (steps 2 through 9) for the technology objects "Pulse2" to
"Pulse4" of the device CPU "LPTO_DevicePlc".
In order to keep the data exchange between controller and device to a minimum,
only the most common parameters for controlling the remote positioning axes are
transmitted.
However, as with local axes, you can also specify parameters in the instance data
block of the position instruction on the device side.
For example, if you want to modify stopping behavior in the event of a lock (enable
"enable" rescinded) of the remote axis 1, proceed as follows:
Table 2-14
No. Instruction
1. Open the instance DB "LPTO_InstControl1" of the FB "LPTO_Control" to control
axis 1 on the device CPU "LPTO_DevicePlc".
© Siemens AG 2019 All rights reserved
Adjust the start value of the input parameter "StopMode" of the instance "instPower"
(FB "MC_Power") accordingly (here: 2 = Emergency stop with jerk control ->
condition: Enable jerk limit -> see Table 2-13, No. 6).
Through the FC "LPTO_Copy", the control orders "control" and the feedback
"feedback" of the remote axes are copied in the DB "LPTO_Data". Access these
data to program the movement of the remote axes. Programming must occur
before the FC "LPTO_Copy" is called.
Using the example of a step sequence in which the remote axis 1 is enabled,
homed directly to the absolute position 0 and then moved to the absolute position
100, the SCL programming is described in Network 1 of the OB "Main".
Table 2-15
No. Instruction
1. Open the cyclic OB "Main" of the controller CPU.
Highlight Network 1 and select "Insert SCL network" by right-clicking.
© Siemens AG 2019 All rights reserved
No. Instruction
2. Enter the necessary parameter specifications in Network 1 as a SCL step sequence.
In the example project the SCL program code is already present.
© Siemens AG 2019 All rights reserved
2.3.8 Commissioning
Table 2-16
No. Instruction
1. First download the PLC project folder "LPTO_DevicePlc" into the device CPU and
start it.
© Siemens AG 2019 All rights reserved
2. The device CPU "LPTO_DevicePlc" has the attribute "IP address is set directly at
the device".
Set the IP address by selecting the network card you use in "Online access".
Then connect online via "Update accessible devices" with the device CPU
"LPTO_DevicePlc" and assign it a free IP address in the subnet of the controller
CPU.
3. Then download the PLC project folder "Controller" into the controller CPU and start
it.
No. Instruction
4. You can use the axis control panel of the technology objects in exactly the same way
as with a local axis:
To do this, open the commissioning screen "commissioning" of the technology object
of the axis to be moved, activate master control and enable the axis.
© Siemens AG 2019 All rights reserved
2.4 Operation
Because the position of the axis is computed internally using the technology object,
you can even test the example project without servo drives connected.
NOTICE If you test the example project with servo drives connected, you must
adjust the configuration of the technology objects to the drives/motors
being used (Chapter 2.3.5) in order to prevent damage.
Table 2-17
No. Instruction
1. Open the data block "LPTO_Data" on the controller CPU and press the "Monitor all"
button.
Here you can start the programmed step sequence (Chapter 2.3.7) with "start" or
select the movement orders individually and monitor the feedback from the device
axes.
© Siemens AG 2019 All rights reserved
The homing modes "homeMode" 2 (passive homing) and 3 (active homing) can
only be tested with a wired HW limit switches (Table 2-1).
3 Appendix
3.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks:
support.industry.siemens.com
Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. Please send queries
to Technical Support via Web form:
www.siemens.com/industry/supportrequest
© Siemens AG 2019 All rights reserved
Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalog
web page:
support.industry.siemens.com/cs/sc
\8\ SIEMENS Industry Mall: SINAMICS V90 basic servo drive system
https://mall.industry.siemens.com/mall/en/WW/Catalog/Products/10354485?tree=C
atalogTree