Beruflich Dokumente
Kultur Dokumente
1
Quick Start Guide for
IOT2040
SIMATIC IOT2040
https://support.industry.siemens.com/cs/ww/en/view/109761191
Warranty and liability
Note The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any 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,
body or health, guarantee for the quality of a product, fraudulent concealment of a
Siemens AG 2018 All rights reserved
Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, systems, machines and networks.
tion 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 only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.
Table of contents
Warranty and liability ................................................................................................... 2
1 Task ..................................................................................................................... 4
1.1 Overview............................................................................................... 4
1.2 Components overview .......................................................................... 5
2 Application Example ......................................................................................... 6
2.1 Download the required software .......................................................... 6
2.2 Load / Unload the PN Device Driver .................................................... 7
2.2.1 Load the PN Device Driver ................................................................... 7
2.2.2 Unload the PN Device Driver ............................................................... 8
2.3 Create a TIA Portal project ................................................................... 8
2.4 Run “test_app” .................................................................................... 16
3 Develop own applications............................................................................... 22
4 Checklist ........................................................................................................... 24
5 Related links ..................................................................................................... 25
6 History............................................................................................................... 25
Siemens AG 2018 All rights reserved
1 Task
1.1 Overview
Introduction
This example shows how to:
Download the Yocto Realtime Image and the PN Driver
Load the precompiled PN Device Driver onto the SIMATIC IOT2040
Create a TIA Portal project with the IOT2040 acting as Profinet Controller
Run the provided “test_app” application to read and write PN I/O data.
Image / Driver: Example Image 2.2 RT and PN Driver can be downloaded and
have to be written / copied to the IOT2000
HSP / TIA Portal: The HSP0258 for the PN Driver V2.1 can be downloaded and
has to be installed in TIA V15. In TIA V15.1 the PN Driver 2.1 is already included.
The TIA Portal has to be used in order to define the hardware configuration and
generate the XML file which is required by the PN Driver on the IOT2000
Application example: The test_app is also part of the downloaded PN Driver and
is delivered in source files as well as ready-to-use binary. If you want to use the
sources to change the test_app you have to use Eclipse with the existing SDK to
develop and compile the test_app. The generated binary has to be copied to the
IOT2000.
Otherwise you can copy the existing test_app binary to the IOT2000 as described
in chapter 2.4.
Siemens AG 2018 All rights reserved
How to deal with all these components is described in the whole chapter 2.
Figure 1-1
2 Application Example
This chapter shows the first steps dealing with the PN Driver making use of the
delivered example “test_app”.
The HSP0258 for the PN Driver V2.1 for TIA V15 can be downloaded here.
Write the IOT2000 Realtime Image to a µSD card and plug it into the IOT2040.
The Image has the static IP address 192.168.200.1 on X1 (eth0) and is set to dhcp
on X2 (eth1) by default.
Use the interface X1 to get connected via putty. The interface X2 is occupied by
the PN Device Driver.
Siemens AG 2018 All rights reserved
Restart the IOT2040 to make the changes take place. To do so, enter:
reboot
Figure 2-1
To load the PN Device Driver once again change to the directory where the
PNDevDrv_32.ko is stored (e.g /usr/src) with
cd /usr/src
And run the command
insmod PnDevDrv_32.ko
Figure 2-3
Siemens AG 2018 All rights reserved
Figure 2-4
Figure 2-5
Siemens AG 2018 All rights reserved
Figure 2-6
6. Add some distributed IO, e.g ET200SP module with some IOs
Figure 2-10
Figure 2-13
NOTE You have to set the interface X2 (eth1) of the IOT2000 to the static IP you have
assigned to the PN Driver in TIA Portal!
./test_app
Figure 2-15
Siemens AG 2018 All rights reserved
1. Press 2 to Start the PN Device Driver and choose a network adapter which is
used for the PN Driver (cannot be used for other things afterwards)
Figure 2-16
Siemens AG 2018 All rights reserved
2. Press 0 to choose the network adapter of the IOT2000 (it is always the
interface X2 (eth1)
Figure 2-17
Figure 2-18
Siemens AG 2018 All rights reserved
When the PN mode has been successfully set to “Operate” was successful and the
configuration is correct, the LEDs of the Distributed IO stop flashing and show that
everything is OK. The test_app gives the feedback you can see in the following
screenshot:
Figure 2-20
Siemens AG 2018 All rights reserved
b. Press 2 to read:
i. Choose I address of byte you want to read
ii. After that. press 0 for status GOOD
Figure 2-22
Siemens AG 2018 All rights reserved
You can find the IO addresses of the Distributed IO in the TIA Portal.
Go to the Device view of the PN Driver and click on Properties -> General
Go to PROFINET interface [X1] -> Overview of addresses
Figure 2-23
Further documentation about the engineering interfaces of the PN Driver and the
IO Base user programming interface can be found in the delivered documents in
the folder PN_Driver_IOT2000\doc\manual:
pn_driver_engineering_interface_manual_en-US.pdf
pn_driver_IO-Base_user_programming_interface_en-US.pdf
Linux environment
You can use a Linux machine to develop Profinet application for the IOT2000 using
Eclipse.
The Eclipse project for the “test_app” is delivered as well, so you can use that as a
starting base for further developments.
How to do that is described in the document “pn_driver_v2_1_quick_start_en-US”
in chapter 4.4 in the folder PN_Driver_IOT2000\doc\manual.
Siemens AG 2018 All rights reserved
Windows environment
You also can use a Windows machine to develop Profinet application for the
IOT2000 using Eclipse. Therefore it is needed that you have installed Eclipse and
the SDK for the IOT2000 in version 2.2.0.
You can download the SDK and documentation how to use it here.
To use the delivered Eclipse project for the “test_app” under Windows you have to
do some additional steps. These steps are describes in the following:
b. Install “mingw-get.exe”
c. Open “MinGW Installer” from Desktop
d. Select “mingw-developer-toolkit”
e. Click on Installation -> Apply Changes
The installer will download the necessary files
b. Go to Project -> Properties -> C/C++ Build -> Tool Chain Editor
Current Toolchain: IOT2000 Chain
Current Builder: Gnu Make Builder
After that you can build the “test_app” and the binary can be found in your project
folder in the Eclipse workspace under /src/examples/test_app/iot2000.
4 Checklist
This chapter contains a checklist which summarizes all important steps in this
application example.
Table 3-1
No. Action
1. Load PN Driver
2. Create TIA Portal project and Compile
3. Copy XML file generated with Compile to the IOT
4. Run test_app
Siemens AG 2018 All rights reserved
5 Related links
Table 4-1
Topic
\1\ SIMATIC IOT2000 forum
www.siemens.com/iot2000-forum
\2\ SIMATIC IOT2000 Setting Up
https://support.industry.siemens.com/tf/ww/en/posts/155642/
\3\ PROFINET driver V2.1
https://support.industry.siemens.com/cs/ww/en/view/109760216
\4\ SIMATIC IOT2000 Getting Started
https://support.industry.siemens.com/tf/ww/en/posts/155643
6 History
Table 5-1
Siemens AG 2018 All rights reserved