Sinamics G S Profinet Connection With Labview 20150904 v20 en
Sinamics G S Profinet Connection With Labview 20150904 v20 en
Sinamics G S Profinet Connection With Labview 20150904 v20 en
http://support.automation.siemens.com/WW/view/en/99684399
Warranty and liability
Security Siemens provides products and solutions with industrial security functions that
informati support the secure operation of plants, solutions, machines, devices, 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. Any third-
party products that may be in use must also be taken into account. For more
information about industrial security, visit
http://www.siemens.com/industrialsecurity
To receive information about product updates on a regular basis, register for our
product newsletter. For more information, visit
http://support.automation.siemens.com.
List of contents
Warranty and liability................................................................................................... 2
1 Task ..................................................................................................................... 4
1.1 Overview............................................................................................... 4
2 Solution............................................................................................................... 6
2.1 Overview............................................................................................... 6
2.2 Hardware and software components ................................................... 7
2.2.1 Validity .................................................................................................. 7
2.2.2 Components used ................................................................................ 7
3 Principle of operation ........................................................................................ 9
3.1 General overview ................................................................................. 9
3.2 Functionality of the basic functions ...................................................... 9
3.2.1 Program details about the block Start.vi .............................................. 9
3.2.2 Program details about the block Stop.vi ............................................... 9
3.2.3 Program details about the block PNIO_STD_TG1.vi ......................... 10
3.2.4 Program details about block PNIO_STD_TG111.vi ........................... 10
3.2.5 Program details about block PNIO_FREE_TG.vi .............................. 11
3.2.6 Program details about block PNIO_READ.vi ..................................... 11
3.2.7 Program details about block PNIO_WRITE.vi.................................... 12
3.2.8 Program details about the block DESCALE_SGL.vi .......................... 12
3.2.9 Program details about the block DESCALE_DBL.vi .......................... 12
Siemens AG 2015 All rights reserved
1 Task
1.1 Overview
Introduction
The application supports you when connecting SINAMICS converters with
PROFINET interface to the LabVIEW software from National Instruments.
This facilitates cyclic I/O communication via any network interface of the PC being
used. LabVIEW operates in this case as PROFINET controller.
Non-cyclic communication via DPV1 is also possible.
Note All of the PROFINET I/O devices available in the hardware catalog of the TIA
Portal can be Incorporated.
The application is primarily intended to control SINAMICS converters.
PG/PC
PROFINET
I/O
SINAMICS G/S
2 Solution
2.1 Overview
Schematic
The application comprises a DLL, which is integrated in LabVIEW and which is
executed there. This provides functions for communication with PROFINET I/O
devices directly from LabVIEW.
Design
The DLL provided by the application is essentially based on the Siemens
PROFINET driver for controllers.
An interface to the LabVIEW has been created via the IO base user programming
interface.
For simpler handling, the application example VIs are provided for standard
Siemens telegrams
• Standard telegram 1 (closed-loop speed control)
• Standard telegram 111 (EPOS operation)
• Free telegram configuration
their interface emulates 1:1 the SINAMICS telegram interface.
Siemens AG 2015 All rights reserved
Advantages
The application described here offers you the following advantages
• Shorter time and lower costs when implementing the solution
• Simple integration of the communication driver
• Simple control of SINAMICS drives from LabVIEW
• Integration of additional PROFINET IO devices in LabVIEW
• Connection via standard Ethernet interface
Restriction
This application does not contain a description of:
• how to use LabVIEW
• commissioning SINAMICS drive systems
• using STEP 7 in the TIA Portal
• DPV1 parameter request and response
Knowledge required
It is assumed that readers have basic knowledge about LabVIEW. Examples
showing the integration into LabVIEW are provided; however, the user is
responsible for the integration in his particular application.
Further, it is assumed that readers are knowledgeable about configuring
PROFINET nodes in the TIA Portal, as well as commissioning SINAMICS
converters and STARTER / SCOUT.
Hardware components
Table 2-1
Component Qty. Article number Note
SINAMICS 1 6ZB2480-0CN00 The demonstration case
demonstration case comprises the following
components:
6SL3040-1MA01-0AA0
6SL3054-0EG01-1BA0
6SL3130-6AE15-0AB1
6SL3120-2TE13-0AA4
6SL3055-0AA00-5BA3
1FK7022-5AK71-1LG0
1FK7022-5AK71-1AG3
ET200S 1 Any distributed I/O can be
optionally integrated
Software components
Table 2-2
Component Qty. Article number Note
LabVIEW 2013 1
Siemens PROFINET 1 6ES7195-3AA05-0XA0 Runtime license must be
driver runtime purchased
WinPCap v4.1.3 1 Freely available
VC++ 2010 SP1 1 Freely available
redistributable
STEP 7 Professional 1 A license is not required
Table 2-3
Component Note
99684399_PNIO_BIB_v20_EN.zip This zipped file contains the LabVIEW
library.
99684399_PN-Driver_HSP.zip This zipped file contains the HSP for
the TIA Portal V12.
99684399_TIA_Project.zip This zipped file contains the TIA V12
project.
Siemens AG 2015 All rights reserved
3 Principle of operation
3.1 General overview
Fig. 3-1: Flowchart
The DLL serves as the interface between the LabVIEW user program and the
PROFINET IO devices. It provides functions, which control the communication and
allow cyclic IO data to be transferred.
This function initializes the PROFINET controller. The Ethernet interface to be used
is selected using the MAC address of the interface.
This function stops the execution of the PROFINET controller. The Ethernet
interface to be used is selected using the MAC address of the interface.
When compiling the communication VIs for the complete PROFINET network, it
must be ensured that the PROFINET controller is first started, and this must be
executed again before closing the application.
In between opening and closing the PROFINET controller, the communication VIs
must be cyclically called (e.g. in a loop).
Siemens AG 2015 All rights reserved
Additional details regarding the structure of the DPV1 parameter task and the
DPV1 parameter response can be reviewed in the "Function Manual Drive
Functions".
The attached example VI is used to read or write a parameter. The data type of the
read parameter is automatically identified, and the read value is converted into a
32-bit floating point number.
Siemens AG 2015 All rights reserved
Fig. 4-1
PROFINET
Siemens AG 2015 All rights reserved
Optiona
Table 4-1
No. Action
1. Connect the PC that you are using with any PROFINET interface of the CU320-2 PN of the
SINAMICS demonstration case. Any Ethernet interface of the PC can be used.
2. Connect the ET200S with any PROFINET interface of the CU320-2 of the SINAMICS
demonstration case. Connecting the ET200S is optional, and is not required to operate the
converter. This is not a component of the application example in LabVIEW.
3. You require STEP7 Professional V13 on your engineering PC in order to configure the PC
station. This should not correspond to the LabVIEW-PC, and must be connected in the
PROFINET network in addition to the components mentioned above.
There are 2 options here:
- If an ET200S is being used, then connect the engineering PC with the free PROFINET
interface of the ET200s
- If an ET200S is not being used, then connect the engineering PC with the free
PROFINET interface of the CU320-2 PN of the SINAMICS demonstration case.
If you want to use one single PC station for the engineering and LabVIEW, then this PC station
must have 2 Ethernet interfaces. In this case, connect the two interfaces with the PROFINET
network.
Note At the present time, the hardware support package required for the application is
not available for STEP7 V13. STEP 7 Professional V12 is required to configure
the PROFINET network.
Table 4-2
No. Action
4. Install LabVIEW in a version >2013 on the PC you are using.
5. Install WinPCap with version 4.1.3 on the PC you are using.
WinPCap can be downloaded from here:
http://www.winpcap.org/
6. Install Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) on the PC you are using.
This can be downloaded here:
http://www.microsoft.com/en-US/download/details.aspx?id=8328
7. Install STEP 7 Professional V12 on your engineering PC.
This can be downloaded here:
http://support.automation.siemens.com/WW/view/en/78793685
Siemens AG 2015 All rights reserved
4.3 Commissioning
Table 4-3
No. Action
10. In the first step, the MAC address of the Ethernet interface selected for PROFINET
communication must be obtained. To do this, the PC must be connected to the CU320-2 and the
operating voltage connected to the SINAMICS Control Unit.
The MAC address of the interface can be identified as follows:
- Right-click on the network symbol in the taskbar and you go to the Network and Sharing
Center
- Right-click on the network connection and then open the network connection status.
No. Action
- On the status page, click on the Details button
- The MAC address of the interface can be taken from the window that then opens. This is
Siemens AG 2015 All rights reserved
subsequently required for communication with the PROFINET I/O devices from
LabVIEW.
11. Please deactivate all of the elements used by the network connection. To do this, proceed as
follows:
- As described in the previous step, return to network connections.
- Right-click on the network connection and then open the network connection properties.
No. Action
- Deactivate all elements:
Siemens AG 2015 All rights reserved
12. Set the IP address of the Ethernet interface of the engineering PC as follows:
- Go to the properties of the Ethernet interface of the engineering PC analogously to the
previous description.
- Select element "Internet protocol Version 4 (TCP/Ipv4)“ and open the properties.
- Here, enter the following addresses:
IP address: 192.168.0.100
Subnet mask: 255.255.255.0
- Save the changes.
13. Unzip the archive that has been made available [Entry-ID]_TIA_Project.zip.
Start the TIA Portal and open the project. The components required for the example are already
preconfigured in the project.
The following settings are relevant for the communication:
- IP addresses:
- PROFINET name:
After the configuration has been completed, the LabVIEW PC station must be compiled. In the
"Devices & networks" view, select the station and in the Edit menu, select the Compile function.
After compilation has been completed, the configuration XML required for LabVIEW is provided
in the following directory:
"<Project directory>/AdditionalFiles/PNDriver/"
Please copy the .XML file generated in this directory to directory ".../user.lib/PNIO/" inserted
under Point 9.
14. Then assign the PROFINET IO devices their PROFINET names and IP addresses.
No. Action
15. Unzip the 99684399_Starter_Project.zip archive provided.
Start STARTER / SCOUT and open the project.
Then transfer the project to the SINAMICS converter.
After these points have been completed, the components have been setup and the application
can be used in LabVIEW. In the next chapter we will tell you how the supplied LabVIEW library
is structured and how the application can be used.
Siemens AG 2015 All rights reserved
Fig. 5-2 – Section of the LabVIEW block diagram of the application example
Siemens AG 2015 All rights reserved
Table 7-1
No. Action Remark
1. Enter the MAC address of the network The MAC address must be entered in the
interface, read out under Point 4.3, Step 10, following format:
which should be used for the PROFINET 00:ab:00:ab:00:ab
communication, in the field MAC address of The individual groups are separated by a
the 1st component of the LabVIEW user colon, lowercase letters are used.
interface of the application exampleVIs
2. Set switch "Start" of the 1st component of the
LabVIEW user interface to "ON"
3. Start the execution of the VIs If all of the components have been correctly
connected and commissioned, a value of 0 is
displayed in field "start_error". The status
fields "state" and "state2" of the drives are
green, and the fault fields of the drives also
indicate a value of 0x0h.
(It can take some time to establish
communications to the drive device. During
this time, fault 0x301h may be displayed. This
disappears as soon as the connection has
been established to the IO device).
Siemens AG 2015 All rights reserved
Table 7-2
No. Action Remark
1. Press the "ON/OFF" button Switch on and switch off the drive object using
OFF1.
2. Press the "Acknowledge" button Acknowledge active faults in the drive object
3. Press the "Jog 1" button Jogging in direction 1 with the jog velocity set
in the drive object
4. Press the "Jog 2" button Jogging in direction 2 with the jog velocity set
in the drive object
5. Press the "Positioning type" button Changing the positioning type
"ON" = absolute positioning
6. Press the "Activate traversing task" button Starting a traversing task
7. "OVERRIDE" entry field Setting the velocity override
8. "Acceleration" entry field Scaling factor of the acceleration set in the
drive object
9. "Deceleration" entry field Scaling factor of the deceleration set in the
drive object
10. "Target position" entry field Entry of the target position in LU
11. "Velocity" entry field Enter the required traversing velocity in 1000
LU/min
Table 7-3
No. Action Remark
1. Press the "ON/OFF" button Switch on and switch off the drive object using
OFF1.
2. Press the "Acknowledge" button Acknowledge active faults in the drive object
3. "Setpoint speed" entry field Enter the required setpoint speed in rpm
Siemens AG 2015 All rights reserved
- Value to be written
Value to be written to the parameter
A section of the program code behind the user interface – the LabVIEW block
diagram – is shown in the following figure:
7 Error codes
The possible error codes of the communication driver are listed in the following
table.
Table 6-1
Error name Error code Remark
PNIO_OK 0x00000000 success
PNIO_WARN_IRT_INCONSISTENT 0x00000010 IRT Data may be inconsistent
PNIO_WARN_NO_SUBMODULES 0x00000011 no submodules to be updated
PNIO_WARN_LOCAL_STATE_BAD 0x00000012 data was written with local state
PNIO_S_BAD, because not all
components of splitted module have
local state PNIO_S_GOOD
PNIO_ERR_PRM_HND 0x00000101 parameter Handle is illegal
PNIO_ERR_PRM_BUF 0x00000102 parameter buffer is NULL-Ptr
PNIO_ERR_PRM_LEN 0x00000103 parameter length is wrong
PNIO_ERR_PRM_ADD 0x00000104 parameter address is wrong
PNIO_ERR_PRM_RSTATE 0x00000105 parameter remote state is NULL-Ptr
PNIO_ERR_PRM_CALLBACK 0x00000106 parameter cbf is illegal
Siemens AG 2015 All rights reserved
8 References
Table 9-1
Topic Title
\1\ Siemens Industry http://support.automation.siemens.com
Online Support
\2\ SINAMICS S120 http://support.automation.siemens.com/WW/view/en/49084671
Function Manual
Drive Functions
\3\ Download page of http://support.automation.siemens.com/WW/view/en/99684399
the article
\4\ SINAMICS http://siemens.com/sinamics-applications
application
examples
9 Contact person
Siemens AG
Industry Sector
I DT MC PMA APC
Frauenauracher Strasse 80
D - 91056 Erlangen, Germany
Siemens AG 2015 All rights reserved
E-mail: tech.team.motioncontrol@siemens.com
10 History
Table 11-1
Version Date Revision
V1.0 08/2014 First Edition
V2.0 01/2015 Examples of acyclic communication