Skip to content

Commit c9aa766

Browse files
Jonas Berghefloryd
authored andcommitted
Improve documentation
1 parent 75508d9 commit c9aa766

18 files changed

+396
-83
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,14 @@ Features:
5252

5353
Limitations or not yet implemented:
5454

55+
* This is a device stack, which means that the IO-controller/master/PLC side is not supported.
5556
* Only a single Ethernet port (no media redundancy)
5657
* No startup mode legacy
5758
* No support for RT_CLASS_UDP
5859
* No support for DHCP
5960
* No fast start-up
6061
* No MC multicast device-to-device
62+
* No support of shared device (connection to multiple controllers)
6163
* No iPar (parameter server) support
6264
* No support for time synchronization
6365
* No UDP frames at alarm (just the default alarm mechanism is implemented)

doc/abbreviations.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ Engineering tool
1212
A desktop program for configuring PLC. For example Siemens TIA portal.
1313
Parameterization
1414
Write parameter values to all submodules
15+
Record data
16+
Data that can be accessed with acyclic Profinet Read and Write. Addressed by
17+
slot, subslot and index.
1518
Transfer syntax
1619
Coding of the different fields in a message. See also "Abstract syntax".
1720

doc/additional_linux_details.rst

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -178,24 +178,14 @@ Profinet MIB:s. On Ubuntu Linux you should change
178178
rocommunity public default -V systemonly
179179
rwcommunity private default -V systemonly
180180

181-
If your linux distribution does give a long description for ``ifDesc`` you can
181+
If your Linux distribution does give a long description for ``ifDesc`` you can
182182
override it by adding a line to the ``snmpd.conf`` file. Adapt the interface
183183
index (last digit in OID) and the interface name::
184184

185185
override 1.3.6.1.2.1.2.2.1.2.3 octet_str "enp0s31f6"
186186

187-
To verify the SNMP capabilities, first use ``ping`` to make sure you have a
188-
connection to the device, and then use ``snmpwalk``::
189-
190-
ping 192.168.0.50
191-
snmpwalk -v1 -c public 192.168.0.50 1
192-
snmpget -v1 -c public 192.168.0.50 1.3.6.1.2.1.1.4.0
193-
snmpset -v1 -c private 192.168.0.50 1.3.6.1.2.1.1.4.0 s "My new sys contact"
194-
195-
If you enable debug logging in the p-net stack, the two last commands will
196-
cause entries in the p-net log.
197-
198-
See :ref:`network-topology-detection` for more details on SNMP.
187+
See :ref:`network-topology-detection` for more details on SNMP and how to
188+
verify the SNMP communication to the p-net stack.
199189

200190

201191
snmpd in a Yocto build

doc/applications_and_porting.rst

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,73 @@ Required features of the hardware
2727

2828
* It should be possible to send and receive raw (layer 2) Ethernet frames
2929
* It should be possible to store data between runs, in a file system or some nonvolatile memory
30+
31+
32+
Minimum cycle time for your application and hardware
33+
----------------------------------------------------
34+
At PLC configuration, there are two adjustable parameters regarding the
35+
cyclic data timing for an IO-device. One basically controls the
36+
frame-to-frame transmission interval (given as a multiple of the cycle time),
37+
and the other one controls the PLC watchdog timeout setting.
38+
The watchdog triggers an alarm when a number of consecutive cyclic data
39+
frames from the IO-device are missing.
40+
41+
During conformance testing, the PLC watchdog timeout setting is 3 x
42+
frame-to-frame interval times, ie the PLC will trigger an alarm if three
43+
consecutive cyclic data frames are missing. Thus the smallest allowed
44+
frame-to-frame interval given in the GSDML file must take the smallest
45+
useful PLC watchdog timeout setting into account.
46+
47+
There can be different factors limiting the ability to send Profinet frames at
48+
a regular pace:
49+
50+
* The initial work at Profinet communication startup should not cause
51+
delays in the cyclic data transmission once started.
52+
* The hardware needs to keep up with the steady-state sending and receiving
53+
of Profinet cyclic data.
54+
* Other work done by the Profinet application, for example work done in
55+
callbacks, might slow down the communication.
56+
* Operating system jitter, which basically is that the operating system is
57+
busy doing other work, will cause frame delays.
58+
* Using a network interface connected via USB can cause additional frame
59+
delays.
60+
61+
For real-time operating systems (RTOS) for example rt-kernel, the
62+
frame-to-frame transmission will have little jitter.
63+
64+
For non-real-time operating systems, for example Linux, the limiting factor
65+
is typically the jitter caused by the operating system.
66+
See the page on Linux timing in this documentation for ideas on improving
67+
Linux real-time properties.
68+
69+
70+
Measure Profinet frame transmission jitter
71+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72+
Set the PLC watchdog time to 100 x frame interval, to avoid any alarms
73+
from the PLC.
74+
Use Wireshark to record cyclic data transmission for a few minutes.
75+
Plot the maximum frame-to-frame transmission interval (see the page on
76+
capturing Ethernet packets in this documentation).
77+
This will show which PLC watchdog setting you need in order not to trigger
78+
"missing frame" alarms.
79+
80+
For example if the transmission interval is 1 ms but there sometimes is a 10 ms
81+
delay between the frames, then you need to use the next standard PLC timeout
82+
value which is 12 ms. In order to handle that with a watchdog setting of 3 x
83+
frame interval, you need to use a minimum cycle time of 4 ms (as
84+
will be stated in your GSDML file).
85+
86+
87+
Example measurement results
88+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
89+
Measurements with p-net on a XMC4800 board running rt-kernel shows that the
90+
hardware is able to send frames with a periodicity of 1 ms with little jitter.
91+
The liming factor is that the PLC watchdog timeout value needs to be 12 ms,
92+
due to the time it takes for the first cyclic data frame to be sent from
93+
the IO-device.
94+
A GSDML file should state that the smallest allowed cycle time is 4 ms.
95+
96+
Similar measurements on a Raspberry Pi 3B+ show that it is possible to send
97+
frames with a cycle time of 1 ms. However there is sometimes a frame-to-frame
98+
interval of up to 40 ms, resulting in that a GSDML file should state that the
99+
minimum frame interval is 16 ms.

doc/compliancetest.rst

Lines changed: 134 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Adjust the settings of the Ethernet card of your personal computer to use
7878
100 Mbit/s full duplex (otherwise the test case "Different access ways
7979
port-to-port" will fail).
8080

81-
Set the IP address to 192.168.0.25 and netmask to 255.255.255.0.
81+
Set the IP address to ``192.168.0.25`` and netmask to ``255.255.255.0``.
8282

8383
Use a separate network for running tests with Advanced RT tester
8484
(avoid running it on a network with unrelated devices).
@@ -136,19 +136,23 @@ Some of the test cases requires additional hardware; a Profinet-enabled switch
136136
("Device B") and an IO-controller ("Device A"). Also a remote controlled
137137
power outlet can be used to simplify the tests.
138138

139-
+-------------------------+-----------------------------+-------------------+
140-
| Item | IP address | Description |
141-
+=========================+=============================+===================+
142-
| Device under test (DUT) | 192.168.0.50 | |
143-
+-------------------------+-----------------------------+-------------------+
144-
| ART tester on PC | 192.168.0.25, 192.168.1.143 | |
145-
+-------------------------+-----------------------------+-------------------+
146-
| PLC ("Device A") | 192.168.0.100 | |
147-
+-------------------------+-----------------------------+-------------------+
148-
| Switch (“Device B”) | 192.168.0.99 | |
149-
+-------------------------+-----------------------------+-------------------+
150-
| Power outlet | 192.168.1.244 | Separate network |
151-
+-------------------------+-----------------------------+-------------------+
139+
+-------------------------+-----------------------------+------------------------+
140+
| Item | IP address | Description |
141+
+=========================+=============================+========================+
142+
| Device under test (DUT) | 192.168.0.50 | |
143+
+-------------------------+-----------------------------+------------------------+
144+
| ART tester on PC | 192.168.0.25, 192.168.1.143 | |
145+
+-------------------------+-----------------------------+------------------------+
146+
| PLC ("Device A") | 192.168.0.100 | |
147+
+-------------------------+-----------------------------+------------------------+
148+
| Switch (“Device B”) | 192.168.0.99 | |
149+
+-------------------------+-----------------------------+------------------------+
150+
| Neighbour (“Device D”) | 192.168.0.98 | To port 2 of DUT |
151+
+-------------------------+-----------------------------+------------------------+
152+
| Neighbour (“Device E”) | 192.168.0.97 | To highest port of DUT |
153+
+-------------------------+-----------------------------+------------------------+
154+
| Power outlet | 192.168.1.244 | Separate network |
155+
+-------------------------+-----------------------------+------------------------+
152156

153157

154158
Profinet-enabled switch
@@ -158,7 +162,7 @@ switch.
158162

159163
The test specification of version V 2.41 recommends the use of a
160164
Siemens Scalance X204IRT (article number 6GK5204-0BA00-2BA3).
161-
It should have IP address 192.168.0.99, netmask 255.255.255.0 and station name "b".
165+
It should have IP address ``192.168.0.99``, netmask ``255.255.255.0`` and station name "b".
162166
Use for example Codesys to scan for the device, and to adjust the IP settings.
163167
Alternatively, use SinecPni to change the IP address (see the Simatic
164168
page in this documentation).
@@ -183,21 +187,31 @@ Connection of the switch ports is described in the table below:
183187
The Automated RT tester will detect "Device B" by itself. No configuration is
184188
required in the Automated RT tester menu.
185189

190+
The setting "Use IEC V2.2 LLDP mode" available via the STEP7 Profinet setup
191+
tool controls the format of the sent portID in LLDP frames.
192+
With the "Use IEC V2.2 LLDP mode" enabled the portID is sent as ``port-001``,
193+
while it is sent as ``port-001.b`` if disabled. The latter format is used in
194+
Profinet 2.3 and newer. The ART tester requires the LLDP format to be in the
195+
2.2 format, otherwise it will complain about portID length.
196+
One way to restore the behavior to the 2.2 format is to do a factory reset
197+
of the switch via the web interface or by pressing the SET button for more than
198+
20 seconds (if the button not is disabled in the web interface).
199+
186200

187201
Remote controlled power outlet
188202
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
189203
The Automated RT Tester can control an "Anel Net-PwrCtrl" power outlet via Ethernet.
190204
It must be connected via a separate Ethernet
191-
interface on the personal computer. Use a static IP address 192.168.1.243 with
192-
subnet mask to 255.255.255.0 on that interface.
205+
interface on the personal computer. Use a static IP address ``192.168.1.243`` with
206+
subnet mask to ``255.255.255.0`` on that interface.
193207

194-
The Power outlet has a default IP address of 192.168.0.244, and it has a
208+
The Power outlet has a default IP address of ``192.168.0.244``, and it has a
195209
built-in web server. Enter its IP address in your web browser to log in
196210
(username and password printed on the hardware).
197-
(You might need to temporary set your Ethernet interface to IP 192.168.0.1
198-
and subnet mask to 255.255.255.0)
211+
(You might need to temporary set your Ethernet interface to IP ``192.168.0.1``
212+
and subnet mask to ``255.255.255.0``)
199213
Modify the IP settings (on the "Einstellung" page) to use a static IP address
200-
of 192.168.1.244.
214+
of ``192.168.1.244``.
201215
On the "Steuerung" page you can control the individual power outputs.
202216

203217
Connect power for your device under test to connector number 3 on the power outlet.
@@ -207,6 +221,21 @@ left of the "PowerOutlet" text in the tool bar. The symbol to the right of the
207221
"PowerOutlet" text shows a green check mark when the outputs are on, and a
208222
black cross when the outputs are off (or when the power outlet not is connected).
209223

224+
+--------------+------------------------------------------------------------+
225+
| Power outlet | Connected to |
226+
+==============+============================================================+
227+
| 1 | PLC "A" |
228+
+--------------+------------------------------------------------------------+
229+
| 2 | Profinet enabled switch "B" |
230+
+--------------+------------------------------------------------------------+
231+
| 3 | Device under test (DUT) running p-net |
232+
+--------------+------------------------------------------------------------+
233+
| 4 | Neighbour device "D", connected to DUT port 2 |
234+
+--------------+------------------------------------------------------------+
235+
| 5 | Neighbour device "E", connected to DUT highest port number |
236+
+--------------+------------------------------------------------------------+
237+
238+
210239
Hardware naming
211240
^^^^^^^^^^^^^^^
212241
Different types of Siemens hardware are used for the conformance test.
@@ -216,23 +245,106 @@ a list of Siemens naming conventions is provided here:
216245
* AI: Analog input module
217246
* AQ: Analog output module
218247
* BA: Basic
248+
* BA: Busadapter (with RJ45 or fiber optic connectors)
219249
* BU: BaseUnit (for mounting input and output modules)
220250
* CM: Communication module
221251
* DI: Digital input module
222252
* DP: Profibus DP
223253
* DQ: Digital output module
224254
* F-: Fail safe
255+
* FC: Fast Connect (A bus adapter for network cables)
225256
* HF: High feature
226257
* HS: High speed
227258
* IM: Interface Module
259+
* L+: +24 V DC
260+
* M: Ground connection
228261
* P: Port
229262
* PN: Profinet
230263
* R: Ring port for media redundancy
231264
* SM: Special module
265+
* SP: Scalable Peripherals
232266
* ST: Standard
233267
* TM: Technology module
234268
* X: Interface
235269

270+
271+
Siemens IO-device for verification of multi-port devices
272+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
273+
274+
+--------------------------------------+-------------------------------------------+
275+
| Part | Comments |
276+
+======================================+===========================================+
277+
| Interface module ET200 IM155-6PN/2HF | |
278+
+--------------------------------------+-------------------------------------------+
279+
| Digital output module DQ 132 | In slot 1 (closest to interface module) |
280+
+--------------------------------------+-------------------------------------------+
281+
| Digital input module DI 131 | In slot 2 |
282+
+--------------------------------------+-------------------------------------------+
283+
| Base uint A0 (24 VDC, light colored) | One for each input/output module |
284+
+--------------------------------------+-------------------------------------------+
285+
| Bus adapter | With two RJ45 connectors |
286+
+--------------------------------------+-------------------------------------------+
287+
| Server module | Delivered with the interface module. Put |
288+
| | it in slot 3. |
289+
+--------------------------------------+-------------------------------------------+
290+
291+
See the Profinet test specification for part numbers.
292+
293+
Light-colored bus adapters are used for supply voltage distribution.
294+
The cyan-colored (auxiliary) terminals on bus-adapters are all connected together.
295+
If you only use light-colored bus adapters, then the cyan-colored terminals on
296+
one bus adapter are isolated from the corresponding terminals on other bus adapters.
297+
298+
Connect +24 V to the red terminals of the interface module and the base units.
299+
Connect 0 V to the blue terminals of the interface module and the base units.
300+
301+
Connect a button via wires to the digital input (DI) module. Connect it between
302+
DI.7 (pin 18) and and +24 V. The LED ".7" on the input module will be green
303+
when the button is pressed.
304+
305+
The LED ".7" on the digital output module (DQ) will be green when the output
306+
is high (+24 V).
307+
308+
.. image:: illustrations/SimaticIoDevice.jpg
309+
310+
See the page on setting up a Simatic PLC in this documentation for
311+
instructions on usage.
312+
313+
314+
Set up Cisco SF352-08P switch
315+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
316+
For multiport Profinet devices, also SNMP-communication to non-Profinet
317+
devices is verified. This Cisco switch can be used for that purpose.
318+
319+
Connect an Ethernet cable to port G1.
320+
Set your laptop IP address to ``192.168.1.143`` and netmask to be ``255.255.255.0``.
321+
Log in to ``192.168.1.254``. Default username is ``cisco`` and password is ``cisco``.
322+
Change password when prompted.
323+
324+
Set the IP address via the left side menu "IP configuration" -> "IPv4 Management and Interfaces" -> "IPv4 Interface".
325+
Click "Add" and enter the static IP address ``192.168.0.98``. Use netmask ``255.255.255.0``.
326+
The switch will change IP address to a new subnet, so you might need to change your
327+
laptop network setting before connecting to the new IP address.
328+
329+
Adjust LLDP settings via menu Administration -> "Discovery - LLDP" -> Properties.
330+
In the page top bar, set "Display mode" to Advanced. Set "Chassis ID Advertisement"
331+
to "MAC Address".
332+
333+
Via Administration -> "Discovery - LLDP" -> "Port settings" select port FE1 and
334+
click Edit. Enable SNMP notification. Select the optional TLVs that start with "802.3".
335+
336+
Via the menu Security -> "TCO/UDP Services", enable "SNMP Service".
337+
338+
In the page top bar, set "Display mode" to Advanced.
339+
Add a SNMP community via the menu SNMP -> Communities and click Add. The
340+
community string should be "public". Set "SNMP Management Station" to "All".
341+
Click "Apply" and "Close".
342+
343+
In the top of the page click the "Save" icon.
344+
345+
For the actual measurements, use the port 1 on the Cisco switch.
346+
347+
236348
Tips and ideas
237349
--------------
238350
If you end up with ``Pass with Hint "The device made a EPM Request from a
@@ -359,7 +471,7 @@ Set the GSDML file attributes ``ConformanceClass="B"`` and
359471
Relevant test cases for multi-port devices
360472
------------------------------------------
361473

362-
* PDEV_RECORDS
474+
* PDEV_RECORDS Requires additional hardware ("Device B")
363475

364476

365477
Relevant test cases for legacy startup mode

doc/creating_gsdml_files.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,14 @@ Use an ``<MAUTypeItem>`` element to describe the Medium Attachment Unit type,
302302
which can be radio (0), copper at 100 Mbit/s (16) or fiber optics.
303303

304304

305+
Additional ports
306+
----------------
307+
Additional physical ports are created by adding ``<PortSubmoduleItem>`` nodes
308+
to the ``<SystemDefinedSubmoduleList>`` node.
309+
The ID, submodule identity number and subslot number shall be unique for
310+
all ports.
311+
312+
305313
Details on the module list
306314
--------------------------
307315
Profinet field devices can have different hardware modules, therefore there is

doc/getting_started_rtkernel.rst

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -291,18 +291,8 @@ SNMP
291291
----
292292
To enable SNMP support, set the ``PNET_OPTION_SNMP`` value to ``ON``.
293293

294-
To verify the SNMP capabilities, first use ``ping`` to make sure you have a
295-
connection to the device, and then use ``snmpwalk``::
296-
297-
ping 192.168.0.50
298-
snmpwalk -v1 -c public 192.168.0.50 1
299-
snmpget -v1 -c public 192.168.0.50 1.3.6.1.2.1.1.4.0
300-
snmpset -v1 -c private 192.168.0.50 1.3.6.1.2.1.1.4.0 s "My new sys contact"
301-
302-
If you enable debug logging in the p-net stack, the two last commands will
303-
cause entries in the p-net log.
304-
305-
For more details on SNMP and its usage, see :ref:`network-topology-detection`.
294+
See :ref:`network-topology-detection` for more details on SNMP and how to
295+
verify the SNMP communication to the p-net stack.
306296

307297

308298
IP-stack lwip

doc/illustrations/SimaticIoDevice.jpg

71.3 KB
Loading

0 commit comments

Comments
 (0)