Skip to content

1. POWERLINK Installation

Frantisek Durovsky edited this page Jun 29, 2017 · 7 revisions

This tutorial describes steps required for enabling POWERLINK communication from Ubuntu:

1. Download POWERLINK software stack

Download the latest Powerlink software stack from this link. In this tutorial v 2.5.2 was used.

Extract archve into your home directory under /home/user/openPOWERLINK_v2.5.2

2. Install dependencies

Install required pcap libraries and cmake-gui utility using apt-get

$ sudo apt-get install libpcap-dev libpcap0.8 libpcap0.8-dev
$ sudo apt-get install cmake-gui

3. Build POWERLINK communication libraries

Run Cmake-Gui utility to simplify configuration of CMAKE options:

$ cmake-gui

Set your source and build path as shown in the figure below:

Run Configure, leave all flags untouched and hit Generate to get the final makefile

Open Terminal, navigate to /home/user/openPowerlink_v2.5.2/stack/build/linux/ and build the sources:

$ make install

4.Build Ethernet POWERLINK driver

As a first step before compiling drivers you need to determine type of your Ethernet controller. Following command does the job:

$ lspci | grep -i net

The output depends on your hardware, for example on B&R APC2100, lspci reveals that 2x i210 Intel Ethernet Controller are available:

Return back to Cmake Gui and this time set source and build path to EDRV as shown in the figure below:

Run Configure and select appropriate option according to the type of your Ethernet controller (in this case i210) and uncheck MN mode if you plan to run this example (PC is controlled node while PLC is managing node)

Now run Generate, navigate to the build folder /home/user/openPOWERLINK_V2.5.2/drivers/linux/drv_kernelmode_edrv/build, build and install POWERLINK driver for your Ethernet Controller by typing

 $ make install

If build succeeded, POWERLINK should be ready for use. Navigate to bin folder of your driver, in this case /home/user/openPOWERLINK_V2.5.2/bin/linux/x86_64/oplkdrv_kernelmodule_edrv/ and load Ethernet POWERLINK Driver:

$ sudo ./plkload oplki210cn.ko

where oplki210cn.ko is a kernel module for your Ethernet Controller located within the same directory. If you get following output and notice wired ethernet disconnected pop up notification, POWERLINK was loaded successfully:

IMPORTANT NOTE: If your Ethernet controller is not listed in the CMake option flags, use POWERLINK deamon based on pcap library. Compile drv_deamon_pcap driver instead of drv_kernelmod_edrv.

5. Build basic POWERLINK demo (OPTIONAL)

If you would like to test if everything works as expected before diving into ROS stuff, you can compile and run basic POWERLINK demo available within the stack.

In Cmake Gui set source and build path to the demo_cn_console from /apps folder as shown below:

Run Configure and select Linux Kernel Module as the CFG_BUILD_KERNEL_STACK option:

Run Generate, navigate to /home/user/openPOWERLINK_V2.5.2/apps/demo_cn_console/ and compile:

$ make install

If build succeeded demo_cn_application should be ready for use. Plug your computer into the Powerlink network, load driver as described in previous step, navigate to the demo_cn_console bin folder /home/user/openPOWERLINK_V2.5.2/bin/linux/x86_64/demo_cn_console/ and run the demo:

$ /.demo_cn_console

If you get following output with state machine changes and mapping table, everything works properly:

If you now press "I", you should see digital output being shifted by one to the right:

6. Where to go next

Next step: 2. ROS Setup & Interface