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 Tue Dec 11, 2018 12:53 pm

All times are UTC+01:00




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

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


Top
   
PostPosted: Wed Nov 09, 2016 1:15 pm 
Offline

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.


Top
   
PostPosted: Tue Nov 15, 2016 2:00 pm 
Offline

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 3.5.9.20 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.


Top
   
PostPosted: Tue Jan 09, 2018 4:31 pm 
Offline

Joined: Tue Jan 09, 2018 11:41 am
Posts: 22
@bmunsil
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 3.5.12.0.
Can you tell me where you found the solution for your problem?
Cheers,
CanBohr


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

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3010
Hi,
to have this script executable is mandatory:
viewtopic.php?f=21&t=8463#p20132


#!/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

BR
Edwin


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

All times are UTC+01:00


Who is online

Users browsing this forum: No registered users and 4 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