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

Fieldbus testing Codesys (PLC <-fieldbus-> Raspberry)

jiri.sal
2019-04-04
2019-04-18
  • jiri.sal - 2019-04-04

    Hi, I am trying to make running communication via ModbusTCP, EtherCAT and ProfiNet on 2 plcs, I have one vitual on my PC running and a second one on Raspberry pi with Codesys runtime, I was able to make Modbus run a simple communication but I am struggling with EtherCAT and ProfiNet. Both PLCs are in one project.
    On ProfiNet I get a ErrorFindEthernet message, I even tried installing winpcap and I added "sysEthernet" to configuration file.
    On EtherCAT I am clueless I dont even know if I have the right devices connected.

    Thanks for your time and I apreciate your help.

    ModbusCom.project [301.97 KiB]

     
  • eschwellinger

    eschwellinger - 2019-04-04

    Hi,
    EtherCAT is not possible without additional hardware.
    You need a gateway device to connect the two masters ( Control Win on your PC and the Raspberry Pi)
    ->EL6692 device

    Profinetnet is possible without additional hardware.
    Here is an example project including 2 PI's as plc's. ( one is Profinet Controller the other Profinet Device)
    l viewtopic.php?f=23&t=6247&p=16870#p16870 l

    BR
    Edwin

     
  • jiri.sal - 2019-04-17

    Hi, thanks for your answer, I looked at the project you provided, and it seems I have everything configured correctly,
    I had changed CODESYSControl_User.cfg on Raspberry and as I said I have winpcap installed and running.

    But it seems I cant get my slave to run, I dont know if there is problem with Ethernet adapter(I havent add sysEthernet component to raspberry tho, i dont know if I have to). My profinet slave device cannot get Ethernet information, it seems. But Slave gets 0 errors in Log, its pretty frustrating already. I am attaching screen of my project.

    Thanks for your help.

    IMG: ProfiNet.project_

     
  • eschwellinger

    eschwellinger - 2019-04-17

    Hi,
    did you add on pn device side (Pi)
    /etc/CODESYSControl_User.cfg

    [SysSocket]
    Adapter.0.Name="eth1"
    Adapter.0.EnableSetIpAndMask=1

    'eth1' or 'eth0'

    and check if on Windows side the firewall is diabled.

    BR
    Edwin

     
  • jiri.sal - 2019-04-18

    Yes, I did add those lines, and firewall is off, I think my Raspi did something because it started to create virtual interfaces for Ethernet, for my testing purposes, I started Codesys on another PC and didn't use Raspberry in the end.
    Communication went fine, now I will proceed to EtherCAT.

    Thanks again for answers.

     

Log in to post a comment.