Configuring a PROFINET Device
Linux
The following configuration steps are necessary in Linux for a standard-compliant behavior (here as an example for Debian/Raspi) :
In the CODESYS project, disable the Adjust operating system settings option for the Ethernet adapter device.
Switch off the protocol filter and allow the IP address to be set in the configuration file (*.cfg) of the CODESYS runtime:
[SysEthernet] Linux.PACKET_QDISC_BYPASS=1 Linux.ProtocolFilter=3 [SysSocket] Adapter.0.Name="eth0" ;name of the ethernet interface that is used for the profinet device Adapter.0.EnableSetIpAndMask=1
Configure the operating system so that the Ethernet adapter starts without the IP address in "promiscuous mode". "Promiscuous mode" is no long necessary in Runtime V3.5 SP13 and higher.
There are different ways to configure the Ethernet adapters, depending on the Linux distribution:
Configuration by /etc/network/interfaces
auto eth0 iface eth0 inet manual up ifconfig eth0 0.0.0.0 up pre-up ifconfig $IFACE promisc up post-down ifconfig $IFACE promisc down
If necessary, deactivate the "Zero Conf" services, such as the avahi daemon:
update-rc.d -f avahi-daemon remove
Configuration by dhcpcd sudo nano /etc/dhcpcd.conf
Example of a static IP configuration:
interface eth0 static ip_address=0.0.0.0
If the "VLAN" Linux package is not installed on the Linux system by default, then install the package.
sudo apt-get install vlan # VLAN-Paket installieren sudo modprobe 8021q # 8021q Kernelmodul laden
The module can be loaded automatically by means of the command
sudo su -c 'echo "8021q" >> /etc/modules'
so you do not have to load it manually each time the system is restarted.
Windows
The following configuration steps are necessary for standard-compliant behavior in Windows:
When using CODESYS Control Win:
Install the Npcap software (for example included in the Wireshark setup).
Important
This note is valid only for CODESYS versions through SP18.
Install the WinPCap software.
By default, Npcap is also installed with the Wireshark installation. You need to disable this option in the Wireshark setup because Npcap must not be installed on the system.
When using CODESYS Control RTE:
WinPCap or Npcap is nor required. Install the supplied, specially adapted Ethernet drivers in the Windows Device Manager. The respective runtime components need to be enabled in the runtime configuration.
Restart the system if you have added a new Ethernet adapter to the system. Otherwise the adapter Ethernet adapter may not be found. In this case, the driver displays the
ErrorFindEthernet
error on the Status tab.In the Windows Control Panel, set a fixed IP address for the Ethernet adapter to be used.
Caution: You must not use an IP address from the address range for automatic assignment (
169.254.x.y
). Instead, use the IP address from a local subnet (for example,192.168.0.x / 255.255.255.0
).Setting the IP address in the config file of the CODESYS runtime is allowed:
[SysSocket] Adapter.0.Name="Profinet Adapter" Adapter.0.EnableSetIpAndMask=1 Adapter.0.ipaddress= Adapter.0.subnetmask=
Start CODESYS Control Win.
At the initial start, some settings for the Ethernet adapter specified in step 3 are applied in the Windows Registry. These are effective after the system has restarted.
After restarting the system, check again in the Windows Control Panel whether or not an address from the address range has been used for automatic assignment for the Ethernet adapter. If this is the case, then use an address from the local subnet.
Restart CODESYS Control Win.
In the CODESYS project, disable the Adjust operating system settings option for the Ethernet adapter device.
VxWorks
The following configuration steps are necessary for standard-compliant behavior in VxWorks:
In the CODESYS project, disable the Adjust operating system settings option for the Ethernet adapter device.
Allow the IP address to be set in the configuration file (*.cfg) of the CODESYS runtime. No IP address should be set initially for this Ethernet adapter.
[SysSocket] Adapter.0.Name="eth0" Adapter.0.EnableSetIpAndMask=1 Adapter.0.ipaddress= Adapter.0.subnetmask=
Configure the operating system so that the Ethernet adapter starts without the IP address in "promiscuous mode". To do this, you need to add these entries to the startup script (for the desired Ethernet adapter):
ifconfig ("gei0 promisc") ipAttach 1,"gei0"