Profinet to CANopen Gateway: Connect S7-1200 to Servo Drives

Key Challenge: Integrating a CANopen-based servo drive with a Profinet PLC without replacing existing hardware.

In modern automated assembly lines, it’s common to find a mix of industrial communication protocols. A typical scenario involves a Siemens S7-1200 PLC acting as the central controller, while field devices like servo drives operate on CANopen. The S7-1200 natively supports Profinet, but not CANopen. This protocol mismatch can stall integration efforts. However, a dedicated protocol gateway offers a cost-effective bridge, enabling real-time data exchange without modifying the existing servo system.

How the Profinet to CANopen Gateway Works

The gateway acts as a transparent bridge between the two networks. On the Profinet side, it appears as a standard IO device, seamlessly integrating into the PLC’s hardware configuration. On the CANopen side, it functions as a master, managing communication with CANopen slaves like servo drives. This dual role allows the PLC to read and write process data as if it were directly connected to the servo.

Process Data Objects (PDOs) are mapped between the two protocols. For instance, control words and target positions from the PLC are transmitted via RPDOs, while status words and actual positions are received via TPDOs. With a typical communication cycle of 4 ms, the system achieves deterministic real-time control suitable for motion applications.

Typical PDO Mapping Example

PDO Type Direction Mapped Objects Profinet I/O Address
RPDO1 PLC → Servo 0x6040 (Controlword), 0x607A (Target Position) Output bytes 100-107
TPDO1 Servo → PLC 0x6041 (Statusword), 0x6064 (Position Actual Value) Input bytes 100-107

Step-by-Step Configuration Guide

The setup involves two main software tools: TIA Portal for the Profinet side and a gateway configuration tool (often named ESCP-CAN or similar) for the CANopen side. Below is a detailed walkthrough.

1. TIA Portal Configuration (Profinet Side)

  • Create a new project and add the S7-1200 PLC.
  • Install the gateway’s GSDML file via Options → Install GSD.
  • Drag the gateway from the hardware catalog into the network view.
  • Assign a unique IP address and device name (e.g., “pn-can”).
  • Configure the I/O data sizes. For basic motion control, 8 bytes output and 8 bytes input are typical.
  • Compile and download the configuration to the PLC.

2. Gateway Configuration (CANopen Side)

  • Open the gateway’s configuration software and create a new project.
  • Set the gateway’s IP address and device name to match the TIA Portal settings.
  • Configure CAN bus parameters:
    • Baud rate: 250 kbit/s (common default for many servo drives)
    • Node ID: 1 (adjustable via DIP switches on the drive)
    • Error behavior: Freeze last valid values on communication loss, timeout 100 ms
  • Import the servo drive’s EDS file to access its object dictionary.
  • Define PDO mappings as shown in the table above. Ensure the I/O byte offsets align with the Profinet configuration.
  • Connect to the gateway via USB and download the configuration.

3. Commissioning and Testing

  • In TIA Portal, go online and assign the device name to the gateway.
  • Monitor the I/Q areas to verify real-time data exchange.
  • Implement the CiA 402 state machine in the PLC program to enable the servo and execute motion commands.

Result: The PLC can now control the servo as if it were a local module, with deterministic performance and full diagnostic capabilities.

Benefits of Using a Protocol Gateway

This approach offers several advantages over replacing drives or adding dedicated motion modules:

  • Cost Savings: Retain existing CANopen servo drives and wiring.
  • Simplified Integration: No need for complex protocol stacks in the PLC; standard I/O access suffices.
  • Real-Time Performance: Cycle times as low as a few milliseconds meet most motion control requirements.
  • Scalability: One gateway can manage multiple CANopen nodes, reducing hardware count.
  • Diagnostics: Transparent access to drive status and fault codes improves troubleshooting.

Common Applications and Use Cases

Profinet to CANopen gateways are widely used in:

  • Retrofit projects where legacy CANopen devices must connect to modern Profinet networks.
  • Multi-vendor environments with mixed PLC and drive brands.
  • Packaging, textile, and assembly machinery requiring precise motion coordination.
  • Test benches and laboratory setups where flexibility is key.

Technical Considerations and Best Practices

When implementing such a gateway, keep the following in mind:

  • Network Topology: Ensure proper termination resistors on the CAN bus to avoid signal reflections.
  • Baud Rate Matching: All CANopen devices must use the same baud rate.
  • PDO Mapping Consistency: The data layout must exactly match between the gateway and the PLC program.
  • Watchdog Settings: Configure appropriate timeout values to handle communication losses safely.
  • Firmware Updates: Keep the gateway firmware up to date for compatibility and security.

Note: Always refer to the specific gateway’s manual and the servo drive’s documentation for detailed parameter settings and limitations.

In conclusion, a Profinet to CANopen gateway is a powerful tool for bridging the gap between different industrial Ethernet and fieldbus systems. It enables seamless integration of CANopen devices into Profinet-based control architectures, preserving existing investments while enhancing system performance and flexibility. Whether you’re upgrading an old machine or building a new one with mixed protocols, this solution provides a reliable and efficient communication path.

Similar Posts