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 Jul 16, 2019 7:33 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Jul 12, 2019 9:05 am 
Offline

Joined: Mon Feb 18, 2019 1:18 pm
Posts: 9
Hello everyone,


My aim is to establish CAN bus network using Raspberry Pi + MCP2515, programmed in CodeSYS.

On the hardware's side, I have connected the SPI pins of MCP2515 to the corresponding SPI pins of Raspberry Pi. As for the INT pin, I have connected it to GPIO25 (this comes after many posts mentioned the use of pin 25 for INT).
The GND and VCC for MCP2515 are connected to GND and 3.3V pin on Raspberry Pi.
I have seperately soldered a 5V connection to TJA1050 by etching out the bridging capacitor.

On the Linux side, I downloaded CAN utils, enabled corresponding overlays, and got the CANbus to working. It is fully functional.
I monitor the messages using PCAN USB Pro.

Now, the real problem is with CodeSYS library.
Everytime I attempt to configure the driver, the CL2 library either throws an "INTERNAL ERROR" or a "NO DRIVER" error!
I loaded every possible CMPManager file, every CodeSYSConfig file on Linux. However, the problem still persists.

I just don't understand what the real problem is.

Can somebody throw some light??
I will be greatly indebted.


Top
   
PostPosted: Fri Jul 12, 2019 10:12 am 
Offline

Joined: Mon Feb 18, 2019 1:18 pm
Posts: 9
Now, the Runtime info on CodeSYS says that a command can't be executed.
Can somebody tell me what's going on?


You do not have the required permissions to view the files attached to this post.


Top
   
PostPosted: Sun Jul 14, 2019 6:23 am 
Offline
Site Admin

Joined: Mon Sep 05, 2005 9:42 am
Posts: 3344
did you add in /etc/CODESYSControl_User.cfg

Code:
[CmpSocketCanDrv]
ScriptPath=/opt/codesys/scripts/
ScriptName=rts_set_baud.sh


the sript is:

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


should be in /opt/codesys/scripts/rts_set_baud.sh
and need to be executable.
sudo chmod +x /opt/codesys/scripts/rts_set_baud.sh

BR
Edwin


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 3 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:  
cron
Powered by phpBB® Forum Software © phpBB Limited