Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

CAN trough SPI ?

Rotule
2014-02-13
2022-07-12
<< < 1 2 3 (Page 3 of 3)
  • johnfarrugia - 2016-04-14

    I looked at the example code but I am unable to determine how the code is linked to the specific J1939 ecu in the tree.

    Also, If the CAN messages are controlled within the program, Why is there a spot to select TX and RX PNG messages in the device?

    Is there a manual on how to use CAN with Codesys?

     
  • eschwellinger

    eschwellinger - 2016-04-14

    Hi,
    sorry to confuse you with that.

    The device tree screenshot is not relatet with the store example.
    CANApi projct from store is for CAN Layer 2 communication.

    J1939 from my screenshot is only to Show how to configure J1939 devices by this configurator pages

    BR
    Edwin

     
  • johnfarrugia - 2016-04-14

    Edwin,

    Is it possible to write a small example for me to read and write a j1939 message using CANpi. I am still confused with using the TX RX entries in the device tree.

     
  • eschwellinger

    eschwellinger - 2016-04-15

    sure if this implementation is stable (SocketCAN)
    you could use:

    Pi as CANopen Master is possible
    Pi as CANopen Slave is possible
    Pi using for CAN Layer 2 communication (Store CAN API example)
    Pi using J1939

    BR
    Edwin

     
  • johnfarrugia - 2016-04-15

    Edwin,

    Can you please Explain when you would use all the PNG RX and TX messages in the device tree under the can ecu module?

    Can you explain the different ways of communicating over CAN with the Pi? You talked about layer 2 which I assume is a level in which all message transactions are performed on a software level within the codesys program. There does however look to be another layer inwhich you can use the RX and TX PNG messages directly within the device tree. Can you explain the difference and how to use the device tree message selections?

     
  • olteanu-eu - 2016-06-28

    i have raspberry pi 3 with pican 2 rev B i make all setting but the can interface i don't see in cosesys , i check the can interface with candump and receive all packet
    Please help me to config can interface

    IMG: puty.png

    IMG: codesys.png

     
  • Coco - 2016-10-03

    First, thank you to all of you have contributed to this thread. Using this, I am able to mostly get everything working. I am using RPI3 and Codesys v3.5 sp9 sp1 and the PiCAN2.

    I have a CANOpen bus coupler and have installed the manufacturers EDS file. The Canbus and CANOpen_manager run fine.
    However, when I try to run the Can slave device, I get the following errors.
    Any advice on how to trouble-shoot this?

    Any advice/suggestions on where to get started?

    IMG: rpi12016

    IMG: rpi22016

     
  • eschwellinger

    eschwellinger - 2016-10-03

    Hi,
    please set the Compiler define: CANOPEN_DEBUG
    After that (compile,download,start the project) check the plc logger for more CANopen debug Information

    BR
    Edwin

    IMG: CANopenDebug_and_check_plclog.jpg

     
  • menno - 2016-10-19

    I do have exactly the same problem, that I can not get CANopen running properly.

    My setup is: 2x Raspberry Pi 3 with CanberryDual 2.1, connected to each other. SocketCAN is working properly and I can send CAN messages from one Raspberry Pi to the next and vice versa. Also in CodeSys, the SocketCAN driver is working properly as CAN messages are received if I configure one Pi as a CANopen slave that produces heartbeat messages.

    What I did is configure one Pi as a CANopen slave, export the EDS file to the other Pi that adds this CANopen device.

    However, the CANopen manager says it is not running. After added CANOPEN_DEBUG, I noticed in the PLC log that it remains stuck in the SDO exchange phase. The message is: SDO read timeout for object 16#1000sub16#00, AbortCode: 16#05040000.

    Appreciated if someone can give some guidance what goes wrong here?

     
  • puma80801 - 2017-10-22

    Hello everybody,

    first thank you very much for the fantastic descriptions.
    I got everything running with J1939.
    But why couldn't i get it running with CANOpen? Which CANOpen-Modul in Codesys do i have to choose.

    Thanks for helping
    Timo

     
  • murdemon - 2018-03-02

    PI can success with NiRen Pi mcp2515... was one problem.. in /boot/config.txt
    dtparam=spi=on
    dtoverlay=mcp2515-can0,oscillator=8000000,interrupt=25
    dtoverlay=spi1-2cs

    I have 8Mhz oscill .. and maximum speed limit on Canopen 500kbs. For 1Mbs needed 16Mhz osill on canoprn board.. and chip selesct in my case 2nd dtoverlay=spi1-2cs

    From another sime PC with Runtime and PeakUSB working fine. Pi was tested as salve and as master on canopen bus.

    And have to connect 5V separate to TJA1050 as here descrbed. https://vimtut0r.com/2017/01/17/can-bus ... nel-4-4-x/ m

    IMG: PI_CanOpenSlave.png

    IMG: Screenshot_Slave_Win64.jpg

     
  • Hartley - 2018-05-24

    [quote="yannickasselin1"]Hi everyone,

    I followed all the steps above and CANbus and CANopen_manager seem to work fine but I still cannot communicate with my Festo Servo Drive through CANopen.
    Can someone help me please.

    Yannick, Did you ever resolve this problem? I am trying to do the exact same thing with RPI and 3 axis CMMP-AS. Please let me know if you did.

     
  • murdemon - 2018-05-25

    You can show screen with PDO and SDO configuration?

     
  • alexmserra - 2022-07-12

    Good afternoon, my at Alexsandro Serra.
    my projects already do with powerlink and modbus rtu communication but I need to implement can. Does anyone have a picture of the raspberry pi 3 card working with the can in codesys, I've done everything and I can't get mine to work, could someone pass it on to me so I could take a look?
    and in case anyone needs help with the Powerlink communication I'm available.

     
<< < 1 2 3 (Page 3 of 3)

Log in to post a comment.