Sie sind auf Seite 1von 46

AKD®

Profinet Sample Project User Manual


Programmed with TIA Portal V13

Edition: 1, August 2017


Original Documentation
AKD PROFINET |

Record of Document Revisions:

Revision Remarks
0.1 07/2017, First revision.
1 08/2017, Updated for motion task editing, formatting

AKD is a registered trademark of Kollmorgen Corporation


TIA Portal is a registered trademark of SIEMENS AG
SIMATIC is a registered trademark of SIEMENS AG
PROFINET is a registered trademark of PROFIBUS and PROFINET International (PI)

Technical changes which improve the performance of the device may be made without prior notice!
Printed in the United States of America
This document is the intellectual property of Kollmorgen. All rights reserved. No part of this work may be repro-
duced in any form (by photocopying, microfilm or any other method) or stored, processed, copied or dis-
tributed by electronic means without the written permission of Kollmorgen.

2 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 1   Table of Contents

1 Table of Contents
1 Table of Contents 3
2 Project Notes 5
3 Project Components 6
4 Introduction to the Sample Project 7
5 Configuration of the AKD 8
6 Starting with the Sample Project 9
6.1 Overview 9
6.2 GSD File Installation 9
6.3 PLC Device Selection 9
6.4 PLC IP Address 10
6.5 AKD Device Name 11
6.6 AKD IP Address 11
6.7 Compile and Download 12
6.8 Go Online 14
6.9 Ladder Programming 14
7 Function Block Reference 16
7.1 Telegram 400 Function Block 16
7.1.1 General Description 16
7.1.2 Notes 21
7.1.3 Detailed input description 21
7.1.4 Detailed output description 23
7.2 Direct Parameter Access Function Block 25
7.2.1 General Description 25
7.2.2 Notes 26
7.2.3 Detail input description 26
7.2.4 Detail output description 27
7.3 Edit Motion Task Position Function Block 28
7.3.1 General Description 28
7.3.2 Notes 29
7.3.3 Detail input description 30
7.3.4 Detail output description 30
8 Creating a New Project 31
8.1 PLC Device Selection 31
8.2 PLC IP Address 32
8.3 GSD File Installation 33
8.4 Add AKD Device 34
8.5 AKD Device Name 35
8.6 AKD IP Address 35
8.7 Create the Profinet Network 36
8.8 Add the Telegram 37
8.9 Telegram I/O Addresses 39
8.10 Compile and Download 39
8.11 Go Online 41
8.12 PLC Project Components 41

Kollmorgen | kdn.kollmorgen.com | August 2017 3


AKD PROFINET | 1   Table of Contents

8.13 Using Function Blocks in New Ladder Program 43


8.14 Multi-Axis 44

4 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 2   Project Notes

2 Project Notes
For better readability of the code, some variables have a prefix of a lower case letter, the definition is as fol-
lowing.

Prefix Size Description


i Unknown Function Block Input
o Unknown Function Block Output
b 1 Bit Bool
by 8 Bit Byte
w 16 Bit Word
dw 32 Bit Double Word

Kollmorgen | kdn.kollmorgen.com | August 2017 5


AKD PROFINET | 3   Project Components

3 Project Components
The sample project contains the following components:

l Telegram 400 Function Block


l Parameter Access (PNU) Function Block
l Edit Motion Task Position Function Block
l Tag Tables
l Data type (UDT)
l Ladder program

Other similar projects for AKD Profinet will have similar components, but each component may vary depend-
ing on the purpose of the project.
A new project can be created using the provided project components. The function blocks can even be mod-
ified to support other telegrams or added functionality. But the sample projects are provided as an initial com-
plete solution, which can then be modified by the integrator as needed.
Revision notes of the projects, components, and even this manual are listed in the ladder program properties
of each project. This includes which revision of each component that is used in each project revision. These
revision notes can also be found in the pdf printouts of the ladder programs.

6 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 4   Introduction to the Sample Project

4 Introduction to the Sample Project

This manual provides instructions and reference information for a sample project used in a Siemens PLC to
control the Kollmorgen AKD drive with Profinet fieldbus communications.  The system contains an S7-1200
or S7-1500 PLC and an AKD-Pxxxxx-xxPN drive. The sample project applies to both the 1200 CPU and the
1500 CPU.  The program code between those versions is identical. This sample project is for a single AKD
axis.  However, it can be easily modified for a multi-axis system.
All Automation functions are controlled by the PLC. The functions covered are the following:

l Initialization (Mapping Telegram 400)


l SW Enable/Disable
l Emergency stop
l Reset of drive faults
l Jog move
l Homing
l Starting of a pre-defined motion task
l Direct motion task configuration and execution
l Read / write access to drive parameters

Each function is controlled by specific bits and variables and the actual values of the drive are read back in
cyclic communication.
This manual should help the PLC programmer understand the communication configuration and function
block integration, and perform some simple motion.
The communication between the AKD (connector X11) and the PLC (connector X1P1) is handled by the
Profinet RT protocol hereafter called Profinet.  The physical connection is via standard Ethernet cable.
In the PLC, the instructions DPRD_DAT and DPWR_DAT are used to exchange cyclic data between the
two devices in “real time”. For the service channel parameter access, the instructions RDREC and WRREC
are used.
At some points this manual refers to the AKD Profinet manual.  The latest manual can be found on the Koll-
morgen website.

Never use the sample project unchanged in an application. The Sample Project is intended as an example of
integrating the AKD into a TIA-Project. This Sample Project must be modified according to the real applic-
ation.

KOLLMORGEN cannot be held liable for any damage caused by the use of the Sample Project or any parts
of it.

This manual consists of 4 major sections:

l Starting with the sample project


l Function block reference information
l Creating a new project
l Modifying the sample project for multi-axis

Kollmorgen | kdn.kollmorgen.com | August 2017 7


AKD PROFINET | 5   Configuration of the AKD

5 Configuration of the AKD

The basic setup of the AKD has to be done in Workbench. The Profinet and Workbench connections can be
used at the same time. The limitation is with the parameter access, as Profinet can deny access to certain
parameters from outside.  The drive should be commissioned and tested prior to setting up the Profinet
communications.  The two important settings relating to Profinet communications are the drive’s name and
the drive’s IP address.

8 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 6   Starting with the Sample Project

6 Starting with the Sample Project

6.1 Overview
The sample project is made available as a TIA archive file.  This allows the entire project to be contained in a
single file.

l Save the TIA archive project file to your PC.


l In TIA Portal, open the Project View.
l Click on Project / Retrieve to open the project from the archive file.

As the project opens, the GSD file will automatically be installed in your TIA system.
After opening the project, go into the “Device Configuration” screen and make the following changes.  The
changes should be made in the offline mode.  After making the changes, compile and download the project to
the PLC. 

l Change the CPU to the actual one being used.


l Set the IP address you want to use for the PLC.
l Set the AKD device name to match drive’s name that was saved in Workbench.
l Set the AKD’s IP address in the AKD Device Properties (this is the AKD’s IP address).

See detailed instructions below for each part of this setup.


The project is set up to make some simple motion using digital inputs on the PLC.  The ladder program uses
the inputs for the following functions, but they can be modified to fit your specific application:
Input 0: E-Stop(Level Triggered, Normally Closed)
Input 1: Reset(Momentary, Normally Open)
Input 2: Enable(Level Triggered, Normally Open)
Input 3: Re-Initialize function block(Momentary, Normally Open)
Input 4: Start move(Momentary, Normally Open)
Input 5: Start jog(Momentary, Normally Open)
This sample project is for a single AKD drive.  You can expand it to multi-axis by duplicating the function
blocks, data blocks, and tags associated with those blocks for each axis.  See the section on Multi-axis for
more details.

6.2 GSD File Installation


To control the AKD by the PLC, the drive must be added in the network list and be recognized as a Profinet
device. The device configuration for the Kollmorgen AKD drive is stored in the GSDML-V2.1-Kollmorgen-
AKD-20141120.xml file.
TIA Portal should install all required GSD files automatically when retrieving the archived sample project.
If the file is not installed automatically, TIA-Portal allows adding a user defined device description file under
Options -> Install general station description file (GSD). The specified file can be chosen and added to the
hardware catalog.

6.3 PLC Device Selection


The sample project is configured for a CPU 1212C DC/DC/DC.  This must be changed to match the actual
PLC hardware that is being used. 

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.

Kollmorgen | kdn.kollmorgen.com | August 2017 9


AKD PROFINET | 6   Starting with the Sample Project

l Right-click on the image of the CPU and click “Change Device.”


l Select your CPU part number.

6.4 PLC IP Address


The sample project is configured with an IP address of 192.168.0.9 for the PLC.  Configure the PLC with any
compatible IP address that you want to use.  This is the IP address that is used for the Profinet com-
munication between the PLC and the AKD drive. 

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.
l Click on the image of the CPU.
l Click on “Properties”. (at the bottom)
l Click on “Ethernet addresses.”
l Enter the IP address you want to use for the PLC.

10 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 6   Starting with the Sample Project

6.5 AKD Device Name


The Profinet name of the device has to match the name of the AKD drive configured in Workbench. You can
set the name in either or both places. The sample project uses the name “AKD-PN” for the AKD device, since
this is the default name specified by the GSD file.

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Right-click on the device name and click “Rename”.
l Enter the name you want to use.

After configuring a drive name in Workbench and saving it, the drive needs to be rebooted in order for the PLC
to recognize that new name.

6.6 AKD IP Address


The sample project is configured with an AKD-Device IP address of 192.168.0.2.  You need to either con-
figure the AKD for 192.168.0.2 static IP using the rotary switches, or configure the IP address of your choice
in the TIA project. 

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.

Kollmorgen | kdn.kollmorgen.com | August 2017 11


AKD PROFINET | 6   Starting with the Sample Project

l Click on the icon of the AKD-Device.


l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Click on “Properties”. (at the bottom)
l Click on “Ethernet addresses”.
l Enter the IP address that you want to use for the AKD drive.

This is the same IP address that is configured by either the rotary switches on the AKD drive or in
Workbench.  It needs to have the same subnet as the PLC’s IP address.

6.7 Compile and Download


The project must be compiled and downloaded to the PLC.

l Select the “PLC_1” heading or the “Program blocks” heading in the project tree.
l Click the “Compile” button in the toolbar.
l Wait for the compile to complete.
l Click the “Download” button in the toolbar.
l Select the PN/IE network and your network hardware and start the search for the PLC.
l Select the PLC in the search results and click “Load”.
l The software will give you some instructions or options prior to downloading (click “Load”).

12 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 6   Starting with the Sample Project

Kollmorgen | kdn.kollmorgen.com | August 2017 13


AKD PROFINET | 6   Starting with the Sample Project

6.8 Go Online
Click the Go Online button on the toolbar to connect to the PLC.  When the software is online, you will see the
header bars turn orange.  There are colored status indicators next to some of the entries in the Project tree and
in the Network Overview.  These indicators should be green.  If the indicators are red, then an error exists.

One example of an error that is common is when the drive name has been saved in Workbench, but the drive
has not yet been rebooted.  The PLC will not recognize the name of the drive and will indicate that an error
exists.

6.9 Ladder Programming


At this point, you can start modifying and adding to the ladder program that is contained in the sample project. 
It is possible that you won’t need certain parts of the existing program, and it’s very likely that you will need to
add more functionality for you application.

14 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 6   Starting with the Sample Project

One item in particular that may need to be changed or removed is the homing command.  By default, the lad-
der program issues the start home command when the drive is enabled for the first time after the drive boots
up.  If you are using a multi-turn absolute feedback device, then you will probably want to remove the homing
altogether.  Your application will dictate how the homing should be started.  This goes for the position moves
and jog move as well.
The PNU read/write may or may not be needed.  If it’s not used for your application, you can remove those lad-
der networks from the program.
Tag names can be changed as needed, but make sure the change is made to every instance of the tag.
Some functions in the sample project ladder program are not set up to be automated.  For example, the PNU
read and writes must be activated manually in the program by forcing the state of the contacts.  You will need
to complete the programming by providing digital inputs or other means of automation for these functions.

Kollmorgen | kdn.kollmorgen.com | August 2017 15


AKD PROFINET | 7   Function Block Reference

7 Function Block Reference

7.1 Telegram 400 Function Block

7.1.1 General Description


The function block “AKD_PN_TG400” is used as the interface for the AKD drive in the PLC. This block sup-
ports the Profinet communication between the S7-1200/S7-1500 PLC and the Kollmorgen AKD-Profinet servo
drive.  It handles the configuration of Telegram 400 and uses Telegram 400 for cyclic data communication for
general command exchange.

16 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

Kollmorgen | kdn.kollmorgen.com | August 2017 17


AKD PROFINET | 7   Function Block Reference

Variable Name Data Type Direction Description


EN Bool In Call of the DB
iID HW_IO In Hardware identifier of the used telegram
iInit Bool In Initialization of the communication with a zero tele-
gram
iEStop Bool In Stop of all motion execution and disable the drive
iSW_Enable Bool In Enable the drive
iStop Bool In Stop of all motion execution
iReset Bool In Reset faults in the drive
iStart_Homing Bool In Start the homing procedure
iStart_Jog Bool In Start of a continuous motion
iStart_Move Bool In Start of a discrete motion
iMT_Pause Bool In Interrupt a discrete motion
iMT_MoveType Word In Motion task control word (MDI_MOD)
iMTNum Word In Motion task number (SATZANW)
iCmdPos DWord In Commanded positon (MDI_TARPOS)
iCmdVel DWord In Commanded speed (MDI_VELOCITY)
iCmdAcc Word In Commanded acceleration (MDI_ACC)
iCmdDec Word In Commanded deceleration (MDI_DEC)

ENO Bool Out DB call done


oInitDone Bool Out Indicates completion of Initialization process
oStatus DWord Out Actual status of the AKD Profinet connection
oPos DWord Out Actual position
oVel Word Out Actual velocity
oCurrent Word Out Actual current
oEnabled Bool Out Indicates when drive is enabled
oError Bool Out Error in Profinet connection or control
oMoving Bool Out Axis is active and moving
oHomed Bool Out Axis is homed
oInPos Bool Out Axis is within the commanded position window
oFault Bool Out AKD drive fault condition exists
oWarning Bool Out AKD drive warning exists

TG_400 UDT_AKD_ Static Profinet data


TG400
wPNReadStatus Word Static Status of the read connection 0 = OK
bPNReadError Bool Static Fault with the read connection
wPNWriteStatus Word Static Status of the write connection 0 = OK
bPNWriteError Bool Static Fault with the write connection

18 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

Variable Name Data Type Direction Description


bResetDone Bool Static Reset of drive faults rising edge
bHomeDone Bool Static Home start rising edge
bStartMoveDone Bool Static Start motion task rising edge
bEstop Bool Static Local flag for estop; True when Estop is active
wStartReset Word Static ZSW2 at the reset time
wStartMove Word Static ZSW2 at the start motion task time
bySDODataArray Byte Static Data array for the service data object exchange
[0..63]
SDOWrite WRREC Static Service data object write
SDORead RDREC Static Service data object read
bSDOReq Bool Static Service data object request
bSDOWriteBusy Bool Static Write active
bSDOWriteDone Bool Static Write done
bSDOWriteError Bool Static Write error
bSDOReadBusy Bool Static Read active
bSDOReadDone Bool Static Read done
bSDOReadError Bool Static Read error
wSDOReadValue Word Static Read service data object value
wSDOAddress Word Static Service data object address
bSWEnabled Bool Static Software enabled and drive active

Status Data (Telegram 400 / position mode)


TG_400.Receive.

Variable Direction Size Description Bit Description Bit Description


ZSW1 IN Int Status word 8 No following Error 0 Read to switch
on
9 Controlled by mas- 1 Ready to operate
ter
10 On target velocity 2 Operation
enabled
11 Homed 3 Fault present
12 Move acknow- 4 No coast stop
ledged
13 Drive stopped 5 No quick stop
14 Motion task active 6 Switch on inhib-
ited
15 - 7 Warning present
AKTSATZ IN Int Last active motion task
ZSW2 IN Int Status word two
XIST_A IN DInt Actual position PL.FB
NIST_A IN Int Actual velocity VL.FB (in 16-bit resolution)

Kollmorgen | kdn.kollmorgen.com | August 2017 19


AKD PROFINET | 7   Function Block Reference

Variable Direction Size Description Bit Description Bit Description


ITIST_GLATT IN Int Actual current IL.FB (in 16-bit resolution)
IDT_DATAITEM_o_ IN Int -
7
IDT_DATAITEM_o_ IN Int -
8
IDT_DATAITEM_o_ IN Int -
9
IDT_DATAITEM_o_ IN Int -
10
IDT_DATAITEM_o_ IN Int -
11
IDT_DATAITEM_o_ IN Int -
12
IDT_DATAITEM_o_ IN Int -
13
IDT_DATAITEM_o_ IN Int -
14
IDT_DATAITEM_o_ IN Int -
15

Control data (Telegram 400 / position mode)


TG_400.Send.

Variable Direction Size Description Bit Description Bit Description


STW1 IN Int Control 8 Jog1 0 On/Off
word
9 Jog 2 1 No coast stop
10 Control by PLC 2 No quick stop
11 Start home 3 Enable operation
12 Real time jog 4 Do Not reject task
13 Invert real time 5 No intermediate
jog stop
14 - 6 Activate task
15 - 7 Fault reset
SATZANW IN Int Motion task number
STW2 IN Int Control word two
MDI_TARPOS IN DInt Motion task target position MT.P*
MDI_VELOCITY IN DInt Target velocity MT.V*
MDI_ACC IN Int Acceleration MT.ACC*
MDI_DEC IN Int Deceleration MT.DEC*
MDI_MOD IN Int Motion task control word MT.CNTL*
HOME_DIST IN DInt Home distance HOME.DIST*

20 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

Variable Direction Size Description Bit Description Bit Description


IDT_DATAITEM_o_ IN Int -
12
IDT_DATAITEM_o_ IN Int -
13
IDT_DATAITEM_o_ IN Int -
14
IDT_DATAITEM_o_ IN Int -
15

*The Profinet data are not mapped 1:1 into the AKD. The PROFIdrive data conversion has to be regarded.
Detailed information can be found in the input description or the Profinet manual.

7.1.2 Notes
The function block uses Telegram 400 for cyclic data communication. The AKD can also be controlled by any
of the other telegrams specified in the AKD Profinet manual.
The Profinet cycle time is 16ms. A new motion task is only accepted after a completed handshake which can
take up to eight cycles.
In the function block status word, the fault number is indicated if a drive fault is active. If only a warning and
no fault is active the warning number is indicated in the status double word. The number is only read on occur-
rence. To reread the number an iReset has to be performed.
In the workbench setup, the drive command source DRV.CMDSOURCE has to be set to zero (Service) and
the DRV.OPMODE to two (position mode). These settings are required for the drive to be position controlled
by Telegram 400.
This project has been createdusing aSiemens CPU1212C-DC/DC/DC and an AKD-P00306-NBPN-0000
with Firmware 1-16-00-002.

7.1.3 Detailed input description


iID
Hardware identifier of the telegram of the corresponding Profinet Device (AKD). The HW_SubModule can be
linked to this input or the value of the hardware identifier can be directly entered. The Value is found with the
properties of the telegram under hardware identifier.

iInit
With the iInit active the Profinet communication gets reset with an all zero send command.  Starts the pro-
cess of mapping Telegram 400.  Only needs to run one time on program start to configure the data for Tele-
gram 400.  Can be activated subsequent times to reinitialize the function block.  It acts as a
PLC/communication reset.

iEstop
Executes an immediate QuickStop.  STW1 Bit2 is set to 0. All motion is brought to halt and the drive is soft-
ware disabled. This uses DRV.DISMODE and the Controlled Stop parameters.  To recover, iReset has to be
executed once.  It inhibits all other STW1 commands until the controlled stop is complete.  Only one scan is
required to start the controlled stop function. Multiple scans are required waiting for motion to stop, before any
other STW1 bits are valid. It sets all STW1 bits=0 when motion stops.

iSW_ENABLE
0 = disables the AKD

Kollmorgen | kdn.kollmorgen.com | August 2017 21


AKD PROFINET | 7   Function Block Reference

1 = enables the AKD


Handles the proper state machine sequence for enabling the drive.  Requires several scans depending on
state machine.

iStop
1 = Stop of all motion in progress without disabling the AKD.  Commands a stop and pause of the motion task
(STW1 bits 4 and 5 = 0) and clears the bits that start jog and home moves (STW1 bits 8, 9, 11, 12 = 0).

iReset
1 = Reset of all active drive faults. The instruction gets executed once per rising edge.  It turns on STW1 bit 7
and then turns it off after 3 scans. Only 1 scan required to start the reset.

iStart_Homing
1= Starts the homing according to the setup done in Workbench. The iCmdPos sets the homing distance
(HOME.DIST) in the AKD, which performs an immediate absolute move after homing The instruction gets
executed once per rising edge.

iStart_Jog
Starts a jog move.  Uses iCmdVel as the jog speed, and iCmdAcc and iCmdDec for the ramps. iCmdVel,
iCmdAcc, and iCmdDec must be non-zero for a jog move to start.
A negative speed setpoint commands a jog move in the negative direction.
STW1 bit12=1 is set during enable process.  STW1 bit 8 is used for the start jog command.
The axis needs to be homed to execute this command.  Requires only one scan to start or stop the jog move. 
Deactivating this input will stop the jog move.

iStart_Move
Starts a motion task position move. iMTNum defines which motion task is started. If iMTNum is set to
0x8000, then the “direct motion task” configured with the iCmdxxx parameters is executed. The instruction is
executed once per rising edge. The execution can take up to eight scans, during which time the iStart_Move
is ignored.
Turns on STW1 bit 6 to start the move, and looks for the "move acknowledgement" to turn off bit 6 after the
move has started.
Requires only momentary activation of this input for one scan to start the move, assuming no stop, home, or
jog commands are active.
Requires being deactivated for at least one scan after the move starts before triggering a new start move com-
mand.
Note: The AKD prevents any other motion (position move, jog, or homing) from being started while any of
these types of moves are in progress. The current motion must complete prior to setting the start bits for a sub-
sequent position move, homing move, or jog move.

iMT_Pause
Pauses (temporarily interrupts) a motion task.
Activating this input sets STW1 bit 5 = 0 to pause the move.
When this input is deactivated (bit 5 set back to 1), the move will continue from where it paused. If a Stop or a
Software disable gets executed, the continuing option is suspended.

22 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

iMT_MoveType
Selects the type of position move: 0 = Relative, 1 = Absolute.
This is the telegram data referred to in the AKD Profinet manual as “MDI_MOD”.

iMTNum
Selects the motion task to be executed.  This is the telegram data referred to in the AKD Profinet manual as
“SATZANW”.
A value of 32768 (0x8000) selects the "Direct Motion Task", which uses the MDI profile data in the telegram
(iCmdxxx inputs) to define the Direct Motion Task (Motion Task 0).
Any value from 1 to 128 selects a preconfigured motion task saved in the drive.

iCmdPos
Target positon/distance for the direct motion task. This is the telegram data referred to in the AKD Profinet
manual as “MDI_TARPOS”.
The position resolution is per default scaled with 2^16 counts/rev. The resolution setting can be adjusted with
PNU 1002.
iCmdPos * 360° / Value PNU 1002 = Position in degrees.
It is also used for HOME.DIST (distance to be moved after homing).

iCmdVel
Target velocity for the direct motion task or real time jog command. This is the telegram data referred to in the
AKD Profinet manual as “MDI_VELOCITY”.
The velocity is scaled with 2^32 equals 12,000 rpm.
iCmdVel * 12000 rpm / 2^32 = Velocity in revolution per minute.

iCmdAcc
Target acceleration for the direct motion task or real time jog command. This is the telegram data referred to in
the AKD Profinet manual as “MDI_ACC”.
The acceleration is per default scaled with 2^16 equals 50,000,000 rpm/sec. The smallest possible value for
acceleration is 763 rpm/sec. To change the interpretation of an acceleration value, the PNU 1008 has to be
set to the according minimum value.
iCmdAcc / value PNU 1008 = Acceleration in revolution per minute per second.

iCmdDec
Target deceleration for a direct motion task or real time jog command. This is the telegram data referred to in
the AKD Profinet manual as “MDI_DEC”.
The deceleration is per default scaled with 2^16 equals 50,000,000 rpm/sec. The smallest possible value for
acceleration is 763 rpm/sec. To change the interpretation of a deceleration value, the PNU 1008 has to be set
to the according minimum value.
iCmdDec / value PNU 1008 = Acceleration in revolution per minute per second.
For a more detail instruction manual use the AKD workbench help at the designated commands.

7.1.4 Detailed output description

Kollmorgen | kdn.kollmorgen.com | August 2017 23


AKD PROFINET | 7   Function Block Reference

oStatus
Shows the actual status word one (ZSW1) in the low word.
Shows any active fault or warning number in the high word.

oPosition
Actual position of the axis (XIST_A) as 32 Bit DWord. The position resolution is per default scaled with 2^16
counts/rev. The resolution setting can be adjusted with PNU 1002.
oPosition * 360° / Value PNU 1002 = Position in degree.

oVel
Actual speed of the axis (NIST_A) as 16 Bit Word. The velocity resolution is with 2^15 equals 12000 rpm
scaled.
oVel * 12000 rpm / 2^15 = Velocity in revolution per minute.

oCurrent
Actual current of the axis (ITIST_GLATT) as 16 Bit Word. The current resolution is with 2^14 equals the max-
imum current of the drive.
oCurrent * DRV.IPEAK / 2^14 = Current in ampere.
Multiplied with the KT of the motor, this gives the actual Torque.

oEnabled
Indicates that the drive is enabled.

oError
Indicates an error in the communication or the PLC command execution.

oMoving
Indicates an active discrete or continuous motion in progress, (jogging, motion task or homing).

oHomed
Indicates that the homing has been done successful. This must be TRUE to start any motion task or real time
jogging.

oInPos
Indicates that the actual position is within MT.POSWND, of the target position, of the executing motion task.
The movement doesn’t have to be finished at this moment. When a motion task is started, the oInPos always
goes Zero for a minimum of one cycle. This also happens if the motion task called gives an error or doesn’t do
any movement at all.

oFault
Indicates a fault on the AKD. The corresponding fault number is in the status word or can be read with PNU
947

24 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

oWarning
Indicates a warning on the AKD. The corresponding warning number is in the status word or can be read with
PNU 2791-2793.

7.2 Direct Parameter Access Function Block

7.2.1 General Description


The direct parameter access works with the second function block “AKD_PNU”. This provides access to all
available AKD parameters that are assigned a PNU number.

Variable Name Data Type Direction Description


EN Bool In Call of the DB
iID HW_IO In Hardware identifier of the corresponding telegram
iStartRequest Bool In Starts a parameter request
iRequestType Bool In Request type: 0 = read, 1 = write

Kollmorgen | kdn.kollmorgen.com | August 2017 25


AKD PROFINET | 7   Function Block Reference

Variable Name Data Type Direction Description


iFormat Int In Format of the requested parameter: 0x41, 0x42, 0x43
iPNUnumber Word In PNU address of the requested parameter
iPNUsubIndex Word In PNU address index of the requested parameter

ENO Bool Out DB call done


oActive Bool Out Request in progress
oDone Bool Out Request done
oError Bool Out Request failed
oStatus DWord Out Status of xxREC function if data exchange fails
ioData DWord In/Out iWrite = 1: data to be written
iWrite = 0: data read
PNURead RDREC Static Read function for the service data channel objects
PNUWrite WRREC Static Write function for the service data channel objects
bDoWrite Bool Static Start write command
bDoRead Bool Static Start read command
byReadArray[0..147] Byte Static Data array for the read command
byWriteArray[0..15] Byte Static Data array for the write command
bPNUWriteBusy Bool Static Write command active
bPNUWriteDone Bool Static Write command finished
bPNUWriteError Bool Static Write command failed
dwPNUWriteStatus DWord Static Write command status
bPNUReadBusy Bool Static Read command active
bPNUReadDone Bool Static Read command finished
bPNUReadError Bool Static Read command failed
dwPNUReadStatus DWord Static Read command status
wDataLenght Word Static Length of the read data
bReqActive Bool Static Rising edge of a new request
wLenght Word Static Length of the write data
byReference Byte Static Reference number of the last request
bReadActive Bool Static Read common execution
bWriteActive Bool Static Write command execution

7.2.2 Notes
The Format of the requested parameter must be 0x41, 0x42, or 0x43.
In read mode, (iRequestType = FALSE), the value of ioData always represents the last read data. In read
mode, ioData is read-only.
Reference the AKD parameter “PN.POSSCALE” for information on position scaling for PNU’s with index
greater than 2000.

7.2.3 Detail input description

26 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

iID
Hardware identifier of the telegram of the corresponding Profinet Device (AKD). The HW_SubModule can be
linked to this input or the value of the hardware identifier can be directly entered. The Value is found with the
properties of the telegram under hardware identifier.

iStartRequest
Starts a read or write command. The instruction gets executed once per rising edge.

iRequestType
Sets the mode to read or write.
0 = Read
1 = Write

iFormat
Sets the format (data size) of the requested parameter. If this value is outside the three possible values, an
error is indicated.
0x41 = Byte, 8Bit
0x42 = Word, 16 Bit
0x43 = DWord, 32 Bit

iPNUnumber
PNU address of the requested parameter. This can be seen in the AKD Profinet manual or in the Workbench
help.

iPNUsubIndex
PNU subindex of the requested parameter.This can be seen in the AKD Profinet manual or in the Workbench
help.

ioData
Output of the read data if iRequestType = FALSE, the value is updated when a new request is started. During
a request the data is zero.
Input if the data is written, iRequestType = TRUE. In write mode, the data is not changed at all in the function
block.

7.2.4 Detail output description


oActive
Indicates a request in progress.

oDone
Is set TRUE with every successful request. The Data are valid form this moment. Done is reset with a new
request or a termination of the connection.

oError

Kollmorgen | kdn.kollmorgen.com | August 2017 27


AKD PROFINET | 7   Function Block Reference

Indicates an error with PNUWrite, PNURead or a validation fault. A validation fault is aninvalid input.

oStatus
Indicates the PNUWrite or PNURead status, only if the function has an error.

7.3 Edit Motion Task Position Function Block

7.3.1 General Description


The function block, “AKD_Edit_Motion_Task_Position”, allows editing of the position value of any saved
motion tasks in the AKD drive, other than Motion Task 0. The motion task must already exist and be saved in
the AKD. This function block can be used as an alternative to the PNU read/write FB to simplify the process
of writing to a motion task position value.

Variable Name Data Type Direction Description


EN Bool In Call of the DB
iID HW_IO In Hardware identifier of the corresponding telegram
iStartRequest Bool In Starts a parameter request
iTaskNumber Word In Number of the motion task to be edited

28 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 7   Function Block Reference

Variable Name Data Type Direction Description


iPosition DWord In New position value

ENO Bool Out DB call done


oActive Bool Out Request in progress
oDone Bool Out Request done
oSuccess Bool Out Write was successful
oError Bool Out Request failed
oStatus DWord Out Status of xxREC function if data exchange fails

PNURead RDREC Static Read function for the service data channel objects
PNUWrite WRREC Static Write function for the service data channel objects
bDoWrite Bool Static Start write command
bDoRead Bool Static Start read command
byReadArray[0..147] Byte Static Data array for the read command
byWriteArray[0..15] Byte Static Data array for the write command
bPNUWriteBusy Bool Static Write command active
bPNUWriteDone Bool Static Write command finished
bPNUWriteError Bool Static Write command failed
dwPNUWriteStatus DWord Static Write command status
bPNUReadBusy Bool Static Read command active
bPNUReadDone Bool Static Read command finished
bPNUReadError Bool Static Read command failed
dwPNUReadStatus DWord Static Read command status
wDataLenght Word Static Length of the read data
bReqActive Bool Static Rising edge of a new request
wLenght Word Static Length of the write data
byReference Byte Static Reference number of the last request
bReadActive Bool Static Read common execution
bWriteActive Bool Static Write command execution

7.3.2 Notes
The function block performs a PNU write sequence that includes writing to MT.NUM, MT.LOAD, MT.P, and
MT.SET.  It then reads the position value back from the task after issuing a new MT.LOAD command, and
compares the value with what was written.  If the values are not the same, it tries the sequence a second
time.
If oDone is TRUE and oSuccess is FALSE, it means that the FB attempted to write the new position value
twice and failed both times.  This can happen if the motion task was not created and saved in the AKD drive’s
memory.
Reference the AKD parameter “PN.POSSCALE” for information on position scaling for PNU’s with index
greater than 2000.

Kollmorgen | kdn.kollmorgen.com | August 2017 29


AKD PROFINET | 7   Function Block Reference

7.3.3 Detail input description


iID
Hardware identifier of the telegram of the corresponding Profinet Device (AKD). The HW_SubModule can be
linked to this input or the value of the hardware identifier can be directly entered. The Value is found with the
properties of the telegram under hardware identifier.

iStartRequest
Starts the sequence to write the motion task position. The instruction gets executed once per rising edge.

iTaskNumber
Selects the motion task. Must be a value ranging from 1 to 128.

iPosition
Sets the value of the position to write into the motion task.

7.3.4 Detail output description


oActive
Indicates a request in progress.

oDone
Is set TRUEwhen the request has been completed. oDone is reset with a new request or a termination of the
connection.

oSuccess
Is set TRUEwhen the position value has been written successfully. oSuccess is reset with a new request or
a termination of the connection.

oError
Indicates an error with PNUWrite, PNURead or a validation fault. A validation fault is aninvalid input.

oStatus
Indicates the PNUWrite or PNURead status, only if the function has an error.

30 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

8 Creating a New Project


Prior to creating a new project, install the GSD file for the AKD. (Under the Options menu)
After creating a new project, go into the device configuration screen to configure the PLC, AKD-Profinet-
Device, and the Profinet network
See instructions below for each part of this setup.

8.1 PLC Device Selection


The easiest way to select the PLC device is to select the entry “Unspecified CPU 1200”.

l Double-click “Add new device”.


l Expand the list of S7-1200 series CPU’s.
l Select “6ES7 2XX-XXXXX-XXXX” under “Unspecified CPU 1200”.
l Select Version V4.0
l Click the hyperlink “detect” to auto-detect the CPU.
l Click “Start search”.
l Click “Detect”.

Kollmorgen | kdn.kollmorgen.com | August 2017 31


AKD PROFINET | 8   Creating a New Project

8.2 PLC IP Address


Configure the PLC with any compatible IP address that you want to use.  This is the IP address that is used
for the Profinet communication between the PLC and the AKD drive. 

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Device View”.
l Click on the image of the CPU.
l Click on “Properties”. (at the bottom)

32 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

l Click on “Ethernet addresses.”


l Enter the IP address you want to use for the PLC.

8.3 GSD File Installation


To control the AKD by the PLC, the drive must be added in the network list and be recognized as a Profinet
device. The device configuration for the Kollmorgen AKD drive is stored in the GSDML-V2.1-Kollmorgen-
AKD-20141120.xml file.
TIA-Portal allows adding a user defined device description file under Options -> Install general station descrip-
tion file (GSD). The specified file can be chosen and added to the hardware catalog.
If the Hardware Catalog already contains the following folders, then there is no need to install the GSD file:

l Other field devices -> PROFINET IO -> Drives -> Kollmorgen -> AKD -> Head module
l Other field devices -> PROFINET IO -> Drives -> Kollmorgen -> AKD -> Module.

Kollmorgen | kdn.kollmorgen.com | August 2017 33


AKD PROFINET | 8   Creating a New Project

8.4 Add AKD Device


If you created a new project or deleted the AKD device from the sample project, the AKD-Device can be
found in the Hardware catalog in the category Other field devices -> PROFINET IO -> Drives -> Kollmorgen -
> AKD -> Head module. Drag and drop the AKD-PN-DEVICE into the Network View. 

34 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

8.5 AKD Device Name


The Profinet name of the device has to match the name of the AKD drive configured in Workbench. You can
set the name in either or both places. The default name specified by the GSD file is “AKD-PN”.

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Right-click on the device name and click “Rename”.
l Enter the name you want to use.

8.6 AKD IP Address


Set the AKD drive’s IP address in the Device Properties for the AKD device. This is the same IP address that
is configured by either the rotary switches on the AKD drive or in Workbench.  It needs to have the same sub-
net as the PLC’s IP address.

Kollmorgen | kdn.kollmorgen.com | August 2017 35


AKD PROFINET | 8   Creating a New Project

l Open the “Device Configuration” screen. (Expand PLC_1 in the Project Tree)
l Select the “Topology View” tab.
l Click on the icon of the AKD-Device.
l Select the “Device View” tab.
l Click on the icon of the AKD-Device (again).
l Click on “Properties”. (at the bottom)
l Click on “Ethernet addresses”.
l Enter the IP address that you want to use for the AKD drive.

8.7 Create the Profinet Network


Link the AKD device to the Profinet master to establish the Profinet Network (PN/IE). This is done by clicking
on the blue “Not assigned” hyperlink in the AKD device icon and selecting “PLC_1.PROFINET interface_1.”

36 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

8.8 Add the Telegram

After the Profinet network connection is defined, the appropriate telegram must be added to the AKD-Device.
Drag and drop the telegram module from the hardware catalog into the Device Overview, (the possible area
highlights in blue under the interface line).
The telegram can be found in the Hardware catalog in the category Other field devices -> PROFINET IO ->
Drives -> Kollmorgen -> AKD -> Module.

Kollmorgen | kdn.kollmorgen.com | August 2017 37


AKD PROFINET | 8   Creating a New Project

38 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

Other telegrams that are supported by the AKD drive and descriptions of the data they contain are listed in the
AKD Profinet manual. The cyclic communication function block in the sample project works with Telegram
400, but you can use any of the available telegrams if you create a function block to support it. Telegram 400
consists of the data in telegram 9 plus some additional free mappable bytes.

8.9 Telegram I/O Addresses


It is important that the input and output start addresses of the telegram data are set to 256 or greater, oth-
erwise there can be conflicts in communication.

8.10 Compile and Download


The project must be compiled and downloaded to the PLC.

l Select the “PLC_1” heading or the “Program blocks” heading in the project tree.
l Click the “Compile” button in the toolbar.
l Wait for the compile to complete.
l Click the “Download” button in the toolbar.
l Select the PN/IE network and your network hardware and start the search for the PLC.
l Select the PLC in the search results and click “Load”.
l The software will give you some instructions or options prior to downloading (click “Load”).

Kollmorgen | kdn.kollmorgen.com | August 2017 39


AKD PROFINET | 8   Creating a New Project

40 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

8.11 Go Online
Click the Go Online button on the toolbar to connect to the PLC.  When the software is online, you will see the
header bars turn orange.  There are colored status indicators next to some of the entries in the Project tree
and in the Network Overview.  These indicators should be green.  If the indicators are red, then an error
exists.

One example of an error that is common is when the drive name has been saved in Workbench, but the drive
has not yet been rebooted.  The PLC will not recognize the name of the drive and throw and error.

8.12 PLC Project Components


At this point, the project is created and the Profinet network is set up, but there is no program.  You can start
writing the program from scratch, or you can import the project components from the sample project.  Import-

Kollmorgen | kdn.kollmorgen.com | August 2017 41


AKD PROFINET | 8   Creating a New Project

ing from the sample project uses a global library.  A global library is a location on your PC that is accessible by
any project in TIA Portal.

l Open the sample project.


l Click on Libraries.
l Create a new global library.
l Drag and drop the following files into the “Master copies” section of the library.
l Close the project.
l Open your new project.
l Drag and drop each file from the library into the appropriate section of the Project Tree.
l Compile and download.

In order to use the function blocks from the sample project, the necessary files are:
FB1 – Function block for telegram 400
FB2 – Function block for PNU access
UDT – PLC data type file (maps the FB data to the telegram)

Optionally, you can use the ladder program from the sample project.  The files are:
Main program
DB1 – Data block for FB1
DB2 – Data block for FB2
Tag table

42 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

8.13 Using Function Blocks in New Ladder Program


If you don’t want to use the ladder program from the sample project, you can open any ladder program and add
the function blocks.  When you place a function block into the ladder, the software will prompt you to create a
data block associated with that function block.  Name it appropriately, so you can identify which function
block and axis it is for. 

Kollmorgen | kdn.kollmorgen.com | August 2017 43


AKD PROFINET | 8   Creating a New Project

The inputs and outputs of the function block must be defined.  Commonly, tags are used these.  You can drag
and drop tags from the tag table or select them from the available list for each input and output on the function
block.
The iID is the hardware submodule identification.  This tells the function block which telegram is being used
for the AKD-Device.

8.14 Multi-Axis

44 Kollmorgen | kdn.kollmorgen.com | August 2017


AKD PROFINET | 8   Creating a New Project

The sample project can be easily modified for a multi-axis system containing multiple AKD drives by adding
duplicate AKD-Devices, function blocks, data blocks, and tags for each axis. It is important to keep the nam-
ing of the function blocks, data blocks, and tags in a convention that is easily understood so it is clear which
ones are for which axis.

Kollmorgen | kdn.kollmorgen.com | August 2017 45


About KOLLMORGEN 
Kollmorgen is a leading provider of motion systems and components for machine builders. Through world-class
knowledge in motion, industry-leading quality and deep expertise in linking and integrating standard and custom
products, Kollmorgen delivers breakthrough solutions that are unmatched in performance, reliability and ease-
of-use, giving machine builders an irrefutable marketplace advantage.

Join the Kollmorgen Developer Network for product support. Ask the community ques-
tions, search the knowledge base for answers, get downloads, and suggest improve-
ments.

North America Europe


KOLLMORGEN KOLLMORGEN Europe GmbH
203A West Rock Road Pempelfurtstraße 1
Radford, VA 24141 40880 Ratingen
USA Germany
Web: www.kollmorgen.com Web: www.kollmorgen.com
Mail: support@kollmorgen.com Mail: technik@kollmorgen.com
Tel.:  +1 - 540 - 633 - 3545 Tel.:  +49 - 2102 - 9394 - 0
Fax:  +1 - 540 - 639 - 4162 Fax:  +49 - 2102 - 9394 - 3155

South America China and SEA


KOLLMORGEN KOLLMORGEN
Avenida Tamboré, 1077 Tamboré - Room 202, Building 3, Lane 168,
Barueri - SP Brasil Lin Hong Road, Changning District
CEP: 06460-000 Shanghai
Web: www.kollmorgen.com Web: www.kollmorgen.cn
Tel.:  +55 11 4191-4771 Mail: sales.china@kollmorgen.com
Tel.:  +86 - 400 661 2802

Das könnte Ihnen auch gefallen