Code Monkey home page Code Monkey logo

ethercat_src's Introduction

ethercat_src ethercat connection for OpenPLC

example workflow

ethercat_src ties Etherlabs IgH EtherCAT master to OpenPLC

links

setup instructions

ethercat_src can be built and installed independently of OpenPLC but is meant to be installed and work with it.

Reference hardware is Raspberry pi 4

Some dependancies should be checked to exist

sudo apt-get install udev
sudo apt-get install libxml2-dev

to install ethercat capable branch of OpenPLC

git clone https://github.com/r2k-in-the-vortex/OpenPLC_v3
cd OpenPLC_v3

ethercat_src is arranged as submodules so these need to be fetched

git submodule init
git submodule update
cd utils/ethercat_src

git submodule init
git submodule update
cd external/ethercat

now Etherlabs IgH EtherCAT master needs to be built and installed

./bootstrap
./configure --sysconfdir=/etc --enable-8139too=no
make
make modules

sudo make install
sudo make modules_install install
sudo depmod

configured to correct ethernet adapter, first figure out mac address of interface you wish to use (ifconfig)

and then configure ethercat

sudo nano /etc/ethercat.conf

set correct mac address to MASTER0_DEVICE="xx:xx:xx:xx:xx:xx" and set DEVICE_MODULES="generic" unless you have a native driver available save the file and exit

a device reboot at this point is recommended

After startup etherlabs master should be running, this can be verified by ls dev/EtherCAT0 and by infomation from sudo ethercat master which shows state of master interface. ethercat --help for more information

sudo ethercat rescan and sudo ethercat xml obtains ethercat slave configuration which needs to be given to ethercat_src

At this point, OpenPLC may be built and installed

cd to OpenPLC_v3 source folder and ./install.sh linux ethercat to install OpenPLC along with ethercat_src

ethercat_src is controlled by conf files, in the OpenPLC folder OpenPLC_v3/utils/ethercat_src/build/ethercat.cfg are the main options

xml file is the previously mentioned slave configuration.

Now OpenPLC can be started, on startup OpenPLC will print out (also in web ide) the pdos - input / output variables it has on ethercat

e.g.

Slave0_Channel_1 AT %IX0.0 : BOOL; (* EK1814 EtherCAT-EA-Koppler (1A E-Bus, 4 K. Dig. Ein, 3ms, 4 K.  *)
Slave0_Channel_2 AT %IX1.0 : BOOL; (* EK1814 EtherCAT-EA-Koppler (1A E-Bus, 4 K. Dig. Ein, 3ms, 4 K.  *)
Slave0_Channel_3 AT %IX2.0 : BOOL; (* EK1814 EtherCAT-EA-Koppler (1A E-Bus, 4 K. Dig. Ein, 3ms, 4 K.  *)
....

These variables must be copied into PLC program and used to access the IO

ethercat_src's People

Contributors

asasd avatar r2k-in-the-vortex avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.