What is Ethernet POWERLINK?
Ethernet POWERLINK is an open, real-time communication protocol that operates on standard Ethernet hardware. Developed by B&R, it is widely used in industrial automation and control systems. An open-source version, openPOWERLINK, also exists to provide broader accessibility and collaboration opportunities.
Advantages of Ethernet POWERLINK over Simple Ethernet
- Real-Time Communication:
- Ethernet: Standard Ethernet is not designed for real-time communication. It can suffer from delays and jitter, making it unsuitable for time-critical applications.
- Ethernet POWERLINK: Provides deterministic data exchange, ensuring data is transmitted within a guaranteed time frame. This is essential for applications like robotics, CNC machines, and automated production lines where timing is crucial.
- Synchronization:
- Ethernet: Lacks built-in mechanisms for precise synchronization of devices. This can lead to inconsistencies and inefficiencies in processes that require coordinated actions.
- Ethernet POWERLINK: Offers precise synchronization capabilities, ensuring all devices on the network operate in harmony. This is vital for tasks like coordinating multiple robots on an assembly line.
- Reliability:
- Ethernet: Susceptible to packet loss and network congestion, which can disrupt communication and lead to failures in industrial settings.
- Ethernet POWERLINK: Designed to handle high-reliability requirements, minimizing the risk of communication breakdowns and ensuring continuous operation.
- Determinism:
- Ethernet: Non-deterministic, meaning the time it takes to send and receive data can vary.
- Ethernet POWERLINK: Deterministic, providing predictable and consistent communication times. This predictability is critical for real-time control applications.
- Openness and Community Support:
- Ethernet: While widely supported, it doesn't have a specific focus on real-time industrial applications.
- Ethernet POWERLINK: Being an open protocol with an active community (including the openPOWERLINK project), it benefits from continuous development, innovation, and a wide range of application-specific enhancements.
Use Cases for Ethernet POWERLINK
- Industrial Automation: Used in factories for precise control of machinery, ensuring all parts of a production line work together seamlessly.
- Robotics: Enables real-time control and coordination of robotic movements, essential for complex tasks.
- Automated Warehousing: Facilitates real-time data exchange between different automated systems, such as conveyors, sorters, and robots, ensuring efficient and error-free operations.
- Process Control: Used in industries like oil and gas, chemical manufacturing, and food processing to maintain tight control over various process parameters in real time.
Conclusion
Ethernet POWERLINK significantly enhances the capabilities of standard Ethernet by adding real-time, deterministic communication, precise synchronization, and high reliability. These features are essential for modern industrial applications where timing, coordination, and uninterrupted operation are critical. By leveraging Ethernet POWERLINK, industries can achieve greater efficiency, reliability, and innovation in their automation and control systems.
In this post, you will learn how to build and test the demo codes and how to adapt them for a simple Raspberry PLC usage.
Installation requirements for Ethernet Powerlink on Raspberry PLC
Implementing Ethernet POWERLINK on a Raspberry PLC requires specific hardware and software components to ensure compatibility and optimal performance. The Open Source PLC Raspberry Pi, a robust and versatile controller, plays a crucial role in this setup, providing the necessary computational power and connectivity options to manage industrial processes efficiently. By leveraging the Raspberry PLC, users can create a reliable and powerful network infrastructure, suitable for a wide range of industrial applications where precision and durability are key.
Dependencies installation
First of all, you will need to install these dependencies in order to be able to install openPOWERLINK:
sudo apt install -y libpcap-dev
sudo apt install -y libsystemd-dev
openPOWERLINK installation
openPOWERLINK must be installed in both computer and Raspberry PLC. Go to this page and download the .tar.gz file. Also, you can clone the openPOWERLINK's Github repository.
After having the openPOWERLINK folder in both devices, follow the instructions:
- Create debug libraries (OPTIONAL):
cd <openPOWERLINK_dir>/stack/build/linux
cmake -DCMAKE_BUILD_TYPE=Debug ../..
make
make install
- Create release libraries:
cd <openPOWERLINK_dir>/stack/build/linux
cmake -DCMAKE_BUILD_TYPE=Release ../..
make
make install
- Build demo application:
cd <openPOWERLINK_dir>/apps/<demo_dir>/build/linux
cmake ../..
make
make install
- You can now run a demo by calling:
cd <openPOWERLINK_dir>/apps/<demo_dir>/build/linux
sudo ./<demo_exec_file>
The master device (the computer) will run "demo_mn_console" and the slave (Raspberry PLC) will run "demo_cn_console". After choosing the correct interface, you will be able to test the demos and understand the basics of Ethernet POWERLINK.
Setting Up Ethernet POWERLINK Connections for Device Communication
To be able to send and receive Ethernet POWERLINK messages, you will need to connect both devices with an Ethernet cable while being in the same subnet.
To establish a successful Ethernet POWERLINK network, ensuring the proper setup of connections between devices is critical. This involves not only physically connecting the devices using an Ethernet cable but also configuring them to operate within the same subnet. Such a setup is pivotal for the seamless sending and receiving of Ethernet POWERLINK messages, which are essential for the real-time control and monitoring of industrial processes. This precise configuration guarantees high-performance communication, crucial for maintaining efficiency and reliability in automated systems.
Customizing your code for optimal performance on Raspberry PLC
The demo code for Raspberry PLC (demo_cn_console) does not interact with physical IOs at all, so let's get into that.
- Install rpiplc library from Industrial Shields.
- Modify files found in <openPOWERLINK_dir>/apps/demo_cn_console/src like so:
1. app.c:
#include <rpiplc.h>
static const uint32_t digitalOutputs[] = {Q0_0, Q0_1, Q0_2, Q0_3, Q0_4, Q0_5, Q0_6, Q0_7};static const int numDigitalOutputs = sizeof(digitalOutputs) / sizeof(uint32_t);
void updateOutputs(void) {int i;
for (i = 0; i < numDigitalOutputs; i++) { if (((digitalOut_l >> i) & i) == 1 ) {digitalWrite(digitalOutputs[i], 1);
} else {digitalWrite(digitalOutputs[i], 0);
}
}
}
2. main.c (bold lines):
#include <rpiplc.h>
static void loopMain(void) {...
printf("--------------------------------\n\n");setupInputs();
initPins(); # For version 2 of the library rpiplc
initExpandedGIO(false); # For version 3 of the library rpiplc
// wait for key hit
while (!fExit) {updateOutputs();
3. In addition, time between polls can be changed in main.c (By default 50 ms):
#define CYCLE_LEN 50000
4. ../CMakeLists.txt:
For version 2 of the library:
TARGET_LINK_DIRECTORIES(demo_cn_console PRIVATE /usr/local/lib)
TARGET_INCLUDE_DIRECTORIES(demo_cn_console PRIVATE /usr/local/include/rpiplc)
TARGET_LINK_LIBRARIES(demo_cn_console ${ARCH_LIBRARIES} rpiplc)TARGET_COMPILE_DEFINITIONS(demo_cn_console PRIVATE RPIPLC_21) # your model
For version 3 of the library:
TARGET_LINK_DIRECTORIES(demo_cn_console PRIVATE /usr/local/lib)
TARGET_INCLUDE_DIRECTORIES(demo_cn_console PRIVATE /usr/local/include/librpiplc/include/)
TARGET_INCLUDE_DIRECTORIES(demo_cn_console PRIVATE /usr/local/include/librpiplc/include/include/)
TARGET_LINK_LIBRARIES(demo_cn_console ${ARCH_LIBRARIES} rpiplc)TARGET_COMPILE_DEFINITIONS(demo_cn_console PRIVATE RPIPLC_V4 RPIPLC_21) # your model and version
Finally, build the demo code again and observe how the outputs change!
Key Takeaways for Successful Ethernet POWERLINK Implementation on Raspberry PLC
To successfully implement Ethernet POWERLINK on Raspberry PLC, it is crucial to focus on precise connections, subnet configurations, and customized code. These steps are foundational for establishing a robust and efficient network, ensuring seamless communication and control in industrial environments. Embracing these practices will enhance automation processes, offering reliability and performance in demanding applications.

First Steps with Ethernet POWERLINK