CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Thu Feb 27, 2020 3:57 am

All times are UTC+01:00

Post new topic  Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Mon Oct 31, 2016 7:41 am 

Joined: Wed Jul 18, 2012 7:04 am
Posts: 6
Codesys Forum,

I would like to use the Raspberry Pi with an SPI CAN module to establish CAN communications. However, I'm unclear on a few points:

With "CODESYS Control for Raspberry Pi SL" is bi-directional CAN communications supported or is it only possible to monitor the CAN bus?

I'm considering the following CAN modules. Can anybody recommend one over another?
SK Pang Electronics - PiCAN2
MikroElektronika - CAN SPI click 3.3V with Pi 2 click SHIELD
IndustrialBerry - CanBerryDual V2.1

If CAN communications is the only requirement is the Beaglebone a better alternative?

Regards, Ben

PostPosted: Wed Nov 09, 2016 1:15 pm 

Joined: Mon Oct 17, 2016 1:49 pm
Posts: 3
CODESYS supports SocketCAN communication. I managed to get CODESYS CAN communication working on a Raspberry Pi 3 with CanberryDual. However, for some reason it only works if one mcp2515-overlay is configured in /boot/config.txt, so only one CAN bus is working. Still figuring out, why that is the case and whether it is a CODESYS or SocketCAN problem. Any help on this appreciated.

PostPosted: Tue Nov 15, 2016 2:00 pm 

Joined: Fri Jul 10, 2015 9:56 am
Posts: 8
I have the PiCanV2 from Skpang it took some browsing of the forums here, but there is a really good thread on it that will help you get it working. you can compile socketcan into you image and configure the codesys control to auto load on CAN1. I actually have an image that I would be more than happy to share if you send me your information. as a side note I am NOT a Linux or Codesys expert. I have just compiled the bits and pieces that the community has provided to make a working system.

so far I have it running on a Raspberry PI B, and Raspberry PI 2 B. I don't have a Raspberry PI 3 yet to get it working but I have been told that there is little difference in the configurations.

I do know however that the Device version doesn't work for me. I have to use an older device version in Codesys V3.

I know this was a bunch of random info put into a not so nicely formatted post but I hope it somewhat helps.

PostPosted: Tue Jan 09, 2018 4:31 pm 

Joined: Tue Jan 09, 2018 11:41 am
Posts: 43
I have a problem with PiCanV2 from Skpang
Codesys gives me the error message "Bus not running"
But the canbus is working on the raspi, I can see messages by using candump can0.
Codesys Version is
Can you tell me where you found the solution for your problem?

PostPosted: Thu Jan 11, 2018 6:54 am 
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3637
to have this script executable is mandatory:

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


PostPosted: Wed Mar 27, 2019 4:33 pm 

Joined: Tue Mar 26, 2019 12:55 pm
Posts: 2
I have similar problem with PiCanV2 from Skpang
Canbus is working on the raspi, I can see messages by using candump can0.
Have installed Codesys Version is
Downloaded CANbus example from the store.
Unfortunately I can not get the example working.

Can you help me please to get this example running on Raspberry 3 controlled with Codesys?

Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 6 posts ] 

All times are UTC+01:00

Who is online

Users browsing this forum: No registered users and 6 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited