------------------------------------------------------------------------------------------
PROFINETEXPLORER
------------------------------------------------------------------------------------------
1. INTRO
1.1 ABOUT
ProfinetExplorer is a graphical program, written in C#, for exploring
and configuring Profinet-IO devices.
The project was created in order to test and evaluate the Profinet
protocol. In specifique we needed a way to test our newly built
Profinet Device. Furthermore we also needed tools to set up and configure
our newly produced units.
The purpose of the project, is to provide an easy accessible platform
for further Profinet app development.
The purpose of the ProfinetExplorer App is to provide a reference
test/browse program for our further development. We use similar programs
for many of our supported protocols. (They're life savers.) I'd recommend
to take a peek at UaExpert for OPC UA and Yabe for BACnet, to name some.
At this stage, I'm still not sure that ProfinetExplorer will be able to
perform the same role as the mentioned programs. For starters, the Profinet
protocol doesn't seem to be very browsable. And the amount of transported
data seems miniscule, when compared to eg. BACnet and OPC. So far, the
focus of Profinet seems to be something like "transport these 8 bytes
really, really fast and really, really often". This is similar to other
fieldbusses like eg. CANOpen. Nothing wrong with that. Only this is not
very interesting on PCs. (PCs can't do really, really fast/often and
what on earth should they use it for anyway.) Still, if I can make
ProfinetExplorer into a "test the connection, test that the unit is
working and perhaps push a few buttons", I'll consider it a success.
For similar programs, I'd recommend to take a look at PROFINET Commander:
https://profinetcommander.com/. This one seems very well polished. It's
prolly much better that ProfinetExplorer. It's not open source nor free.
(Price is reasonable though.) Biggest issue is that it depends on the
Siemens STEP 7 TIA Portal. This one is a non free/open 7 GB
installation. I never got around installing this.
This document is subject to change.
1.2 CURRENT PROGRESS
The basic protocols have been implemented: DCP (Device Config Protocol),
RT (Real time) and ProfinetIO. The program is able to edit DCP data, open
a GSDML document, connect to a IO device, establish connection and start
the cyclic data. At least it seems to work on our test devices. Much is
still missing. The program is not really able to use the GSDML for
anything useful. It's still not able to decode the cyclic data or send
back any cyclic data. And much of the setup is default. (Meaning that
I don't know what they do.) However, it seems to be good enough for what
we're trying to do.
1.3 INSTALLATION REQUIREMENTS
Project is dependant on the WinPcap driver. So please install this
before use.
1.4 CREDITS
The projected is created by me, Morten Kvistgaard, anno 2015.
Graphics are the usual FamFamFam: http://www.famfamfam.com/
Much code & design is from the Yabe project:
https://sourceforge.net/projects/yetanotherbacnetexplorer/
(Also created by me.)
The PCAP module is from SharpPcap & WinPcap:
https://sourceforge.net/projects/sharppcap/
http://www.winpcap.org/
2. USAGE
2.1 NETWORK SETUP
For startes you need to select what or which network interfaces you'll
be using for your Profinet endeavours. Real time Profinet (the really,
really fast 8 bytes) can be a strain on your regular net, so you
might want to dedicate a seperate net card. If you just plan to browse
the device and perhaps set the IP/name, then go ahead and plug it into
the company net.
Press the "Add Network Interface" and select your net card. The net card
will be represented under the "Devices" tree.
2.2 DISCOVER DEVICES
When you've added your net card, you'd want to search the net for Profinet
Devices. Press the "Search For Devices". (The program might do searches
by it self, but go ahead and press it anyway. It can't hurt.) The found
devices will be listed under the net card, in the "Devices" tree.
2.3 READ/WRITE DCP
When you've found a Profinet device, select it in the "Devices" tree.
This will populate the "Address Space" tree. Expand the "Device config
(DCP)" node and select the property "DeviceProperties_NameOfStation".
This will make the program fetch the device name and display it, in the
"Properties" list. If you edit the name (and press enter or remove the
focus) the edited name will be written to the device.
2.4 LOG
During your work, keep an eye on the "Log" in the buttom. This will
record actions and irregularities in the program and protocol.
2.5 CUSTOM READ/WRITE DCP
ProfinetExplorer is able to perform specialized read/writes. Also classed
as 'Manufactor' settings, in the standard. From the "Options" menu, select
the "Add Manufactor DCP entry". Enter the following data:
Name: MySignal
Option: 5
SubOption 3
Is Readable: true
Is Writeable: true
Press "OK" and a new DCP option will be added to the "Address Space" DCP
node. Select the node. The program will now perform a "read" against the
given option. The device will most likely respond with a
"OptionNotSupported" error code. If you press the button "Reload all
entries", located in the "Properties" list, the program will perform the
"read" again. (Who knows? It might have redecided.) Press the button
"Insert empty/generic data" located besides the reload. This will insert
an array in the "Properties" list. In this array insert 2 entries. The
first entry should have the value "1" and the second should be "0". Now
press the "Rewrite all entries" button. The program will now perform a
"write" with the given data. If done correctly, the device should now
flash with the LEDs. (The custom option is actually the 'signal' option.
And there's a button to do that. This was just an example.)
If you want to remove the Manufactor option again, open up the "Settings"
dialog. (Via the "Options" menu.) Find the setting
"ManufactorSpecificDCPOptions", enter the collection and remove it.
Hopefully, you never have to use these features.
2.6 CONNECT IO
To establish a connection to a ProfinetIO device. Select it in the tree
and press the "Connect IO" button. This will send the required 'connect'
messages. The device will now start sending cyclic and acyclic data to
the program, which will be displayed in the main area.
3. TECHNICAL
3.1 ETHERNET TRANSPORT
The Profinet DCP & RT protocol is a "base ethernet" protocol. Meaning that
it runs directly on top on the ethernet. This means that you can't access
it with regular berkeley sockets or Windows drivers. (At least, not
to my knowledge. Maybe you can with udp raw sockets.) To solve this,
I've used WinPcap. This is normally used for 'packet capture'. Eg.
sniffing with programs like Wireshark. I've seen it used similarly
with other ethernet fieldbusses though and it seems to work.
3.2 SERVER SOCKETS
When communicating with udp servers (the ProfinetIO is udp based),
you usually create a socket (on the first free port), sends a request to
a given port and receives a response *from* the given port, back to your
source port. This is a normal 'unicast request/receive' pattern and
firewalls and drivers will recognise it as such. However one of the test
devices (Renesas TPS-1) is breaking with this pattern and sends the
response from a 3rd port. This could be an error in the Renesas. However
our test controller didn't seem to have a problem with this behavior, so
I adjusted our end instead and created the socket as a 'server socket'.
4. TESTS
Project has been tested against a Renesas TPS-1 ASIC, a Hilscher and a
Bachmann PLC. All with certified Profinet Stacks. Project has been tested
on a regular win32 PC with an extra (normal/consumer grade) ethernet card
for the Profinet. Much of the validation has been performed with the aid of
Wireshark.
5. SUPPORT
There's no support for the project at this time. That's reserved for our
customers. If you write to me, I'm unlikely to answer.
6. REPORT ERRORS
Yeh, there be errors alright. There always are. Many won't be interesting
though. Eg. if you find a computer that behaves differently from others,
I'm unlikely to care. This is not a commercial project and I'm not trying
to push it to the greater good of the GPL world. (This may change though.)
If you find a device that doesn't work with ProfinetExplorer, it might be
interesting. But in order for me to fix it, I need either access to the
physical device or printouts from programs like Wireshark, that displays
the error. Write to me at mk@pch-engineering.dk.
7. CONTRIBUTE
Really? You think it's missing something? It's not really meant as a huge
glorified project you know, but if you really must, try contacting me
at mk@pch-engineering.dk.
8. MISC
Project web page is located at:
https://sourceforge.net/projects/profinetexplorer/