Codesys cannot find ConCAN

Topics about the Hardware of Revolution Pi
Post Reply
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40

Codesys cannot find ConCAN

Post by Elon Sha »

Hi,

I am using Connect module and ConCAN module. I want to use Codesys to implement CanOpen communication. However, things didn't go so smoothly.

I have updated my image to the latest version. I am using CODESYS Control for Raspberry PI 3.5.16.0.package and RevolutionPiBridgeV1.0.1.99.package.

At the left side of the connect module, I attached an AIO module and it worked well in codesys. I attached a ConCAN module on the left side of connect module. But, when I tried to run the program, a red triangle appears on the left side of the ConCAN module which means Codesys cannot find the ConCAN module.

I tried to create a script in this tutorial and reboot the device. But it doesn't work.
https://revolution.kunbus.com/tutorials ... en-master/

If I use the command "ifconfig -a", I can see the can0 interface in the list. But it doesn't work in codesys.

I also tried to see the codesys log, please see the attachments.
Attachments
微信图片_20210129231012.jpg
微信图片_20210129231012.jpg (174.27 KiB) Viewed 7555 times
f_und_e
Posts: 14
Joined: 03 Dec 2020, 14:38

Re: Codesys cannot find ConCAN

Post by f_und_e »

Elon Sha wrote: 29 Jan 2021, 16:11 I attached a ConCAN module on the left side of connect module. But, when I tried to run the program, a red triangle appears on the left side of the ConCAN module which means Codesys cannot find the ConCAN module.
Hello,

You need to attach it to the right side of the connect, you have to do the same thing in Codesys as well - then it will be detected.
concacn_codesys.PNG
concacn_codesys.PNG (5.83 KiB) Viewed 7496 times

Sadly, I do not understand how to use it once it's attached in Codesys... If I follow the procedure from the tutorial, nothing works.

Best regards
Elon Sha
Posts: 18
Joined: 17 Aug 2020, 11:40

Re: Codesys cannot find ConCAN

Post by Elon Sha »

I made a mistake in the previous post. I did connect the ConCAN module to the right side of the connect module and did the same thing in Codesys. I can also see the CAN interface through the "ifconfig -a" command, but codesys cannot detect the existence of the ConCAN module.
User avatar
Amar
KUNBUS
Posts: 160
Joined: 15 Jul 2019, 12:58

Re: Codesys cannot find ConCAN

Post by Amar »

Here is an example Codesys Connect project with Con CAN.
Download Link:
https://kunbusgmbh-my.sharepoint.com/:u ... g?e=EiwGB0
or
https://kunbusgmbh-my.sharepoint.com/:u ... Q?e=Wl0ZD6


For Configuring Con CAN module you need to :
create 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

Make the script executable
sudo chmod +x /var/opt/codesys/rts_set_baud.sh

Enable con CAN from command
sudo revpi-config enable revpi-con-can

or
Enable con CAN from pictory

Download the Codesys Program

Important: Thereafter, a reboot is required

Then check codesys status
also cross check with command piTest -d if Con CAN module is found.

If you still have issues, then please send us your Project and kernel log for investigation.

Regards,
Amar
KUNBUS
Post Reply