Codesys and ConCAN

Topics about the Hardware of Revolution Pi
Post Reply
f_und_e
Posts: 14
Joined: 03 Dec 2020, 14:38

Codesys and ConCAN

Post by f_und_e »

Hello there,

I've been trying to use the ConCAN module with the new Codesys library, but sadly it is not possible (for me). It seems like others have problems aswell, but at least Codesys detects it.

I found out that it is not possible to configure it with Pictory, but with Codesys - you need to attach it to the device within Codesys. It seems like Codesys is overwriting the configuration files of pictory. I added the script which is shown in the tutorial. When I log in into the application, the ConCAN is detected (green symbol next to it in the device tree).

Sadly, I do not know how to communicate with it - using the way which is shown in the tutorial does not work.


It would be very kind if someone could help me!

Thank you very much in advance.
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Codesys and ConCAN

Post by Amar »

Hi,
The new Revolution Pi Codesys library works independent of pictory configuration and overwrites the config.rsc file at application startup.

You need to do following steps:
1) configure Connect and Con Can module to Right side in codesys IDE.

2) configure the script for setting baud rate
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


3) Enable RevPi Con CAN either from pictory or using following command
sudo revpi-config enable revpi-con-can

4) Download codesys application

5) reboot system or do a hard reset

6) Con CAN module should then work with Codesys.

Here is an example which also has an Con CAN module running CAN Open master and communicates with Kunbus CAN Open Gateway.Check CANopen I/O mapping in this example.

Attachment:
https://kunbusgmbh-my.sharepoint.com/:u ... Q?e=0LDtzS

Regards,
Amar
KUNBUS
f_und_e
Posts: 14
Joined: 03 Dec 2020, 14:38

Re: Codesys and ConCAN

Post by f_und_e »

Hello Amar,

Thank you so much for the demo project and the description! This helped me a lot.

All the best
Post Reply