Skip to main content

CODESYS Example: RevPiConCAN

Introduction

This tutorial demonstrates how to run a CANopen Master on a RevPi Connect with a RevPi Con CAN module and exchange data with KUNBUS Gateways CANopen and Modbus RTU.

Prerequisites

Hardware Requirements

  • 1 RevPi Connect
  • 1 RevPi ConCAN

Software Requirements

  • CODESYS Development System installed on your PC

Preparation

Hardware Setup:

  • The RS485 interface of the RevPi Connect is connected to the Modbus RTU Gateway.
  • The Con CAN interface of the RevPi Connect is connected to the CANopen Gateway.
  • Both Gateways are connected via piBridge.

Tipp: For detailed instructions about how to set up your system, refer to the Getting Started guide.

Software Setup:

note: To ensure a compatible system with suitable software, please refer the following links:

Overview

The example runs:

  1. A CANopen Master and a Modbus RTU Master on a RevPi Connect.
  2. KUNBUS CANopen Gateway as a CANopen Slave.
  3. KUNBUS Modbus RTU Gateway as a Modbus RTU Slave.
  4. A byte of data is exchanged between the CANopen and Modbus RTU networks.
  5. The application logic increments the value by 1 in each application cycle.

The following figure shows the CODESYS device tree overview of the example.

Project Setting

Application Mapping of the first byte from the CANopen Master running on the RevPi Connect with the CANopen Gateway.

Project Setting

Application Mapping of the first byte from the Modbus RTU Master running on the RevPi Connect with the Modbus RTU Gateway.

Project Setting

The following figure shows the application logic of this example.

Project Setting