RevPi as CANopen Slave in Codesys

Topics about the Software of Revolution Pi
Post Reply
Doctor.No
Posts: 2
Joined: 31 Mar 2021, 09:55
Answers: 0

RevPi as CANopen Slave in Codesys

Post by Doctor.No »

Dear Colleagues,

there is a very nice post about how to setup Codesys as a CANopen Master, however I wonder if it is also that simple to use the RevPi Connect/RevPi Con CAN configuration as a CANopen Slave?

(The use case is to read data from the canbus (wheel sensors), calculate the control system in RevPi and send the calculated steering commands to the 3rd Party CANopen Master)

Thanks a lot!

Codesys as CANopen Master: https://revolution.kunbus.de/tutorials/ ... en-master/

(PS: I would like to buy your hardware as soon as possible, if it is possible to run it as CANopen Slave in Codesys)
Amar
KUNBUS
Posts: 157
Joined: 15 Jul 2019, 12:58
Answers: 4

Re: RevPi as CANopen Slave in Codesys

Post by Amar »

Hello,
Yes, CANopen Slave can also used with Codesys on RevPi Connect. The procedure for running RevPi Can Open Codesys Slave is similar to that of Master.

For Rev Pi Con Can Master Slave the following step for setting baud rate and enabling Con Can Module remains same.

sudo nano /var/opt/codesys/rts_set_baud.sh

#!/bin/sh
BITRATE=`expr $2 \\* 1000`
ifconfig $1 down
echo ip link set $1 type can bitrate $BITRATE
ip link set $1 type can bitrate $BITRATE
ifconfig $1 up

sudo chmod +x /var/opt/codesys/rts_set_baud.sh
sudo revpi-config enable revpi-con-can


The only difference then is to configure the Can Open slave in Codesys device tree.
2021-04-12 12_06_14-Add Device.png
2021-04-12 12_06_14-Add Device.png (51.82 KiB) Viewed 2153 times
Regards,
Amar
KUNBUS
Post Reply