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:
- A CANopen Master and a Modbus RTU Master on a RevPi Connect.
- KUNBUS CANopen Gateway as a CANopen Slave.
- KUNBUS Modbus RTU Gateway as a Modbus RTU Slave.
- A byte of data is exchanged between the CANopen and Modbus RTU networks.
- The application logic increments the value by 1 in each application cycle.
The following figure shows the CODESYS device tree overview of the example.
Application Mapping of the first byte from the CANopen Master running on the RevPi Connect with the CANopen Gateway.
Application Mapping of the first byte from the Modbus RTU Master running on the RevPi Connect with the Modbus RTU Gateway.
The following figure shows the application logic of this example.