Simple Open EtherCAT Master or SOEM
v1.2.0
SOEM is an EtherCAT master library written in c. Its purpose is to learn and to use. All users are invited to study the source to get an understanding how an EtherCAT master functions and how it interacts with EtherCAT slaves.
As all applications are different SOEM tries to not impose any design architecture. It can be used in generic user mode, PREEMPT_RT or Xenomai.
Preconditions :
- Linux 2.6 kernel.
- GCC compiler (others might work, just not tested).
- One (or two if in redundant mode) 100Mb/s NIC that can connect to a RAW socket.
- Application must run as root / kernel.
Features as of 1.1.2 :
- Connects to a standard RAW socket.
- Full redundancy support.
- Recovery of "out-of-order" frames.
- Low level functions, BRD, BWR, APRMW, FPRD, LRW....
- Blocking or non blocking transfers.
- Automatic configuration of slaves.
- Use of internal configuration table (quick).
- Use of slave internal data in EEprom and/or CoE.
- Setting and reading of slave state.
- Automatic generation of processdata mapping.
- Mailbox link layer support with resend toggle.
- CoE, SDO read / write.
- CoE, Complete Access support.
- CoE, Segmented transfer support.
- CoE, Object Description list
- CoE, Emergency and abort SDO support.
- Distributed Clock (DC) support.
- Automatic configuration of DC slaves.
- Automatic sync of clocks with process data exchange.
- Flexible settting of sync0 firing per slave.
- Access to slave functions through one slave structure.
- EEPROM read / write.
- Local cache for EEPROM access with automatic 4/8 byte reading.
- SII parsing.
- Portable code, only standard c, usable for embedded applications.
- All buffers are static so can be memory locked.
- Support for Little and Big endian targets.
Features as of 1.1.3 :
- CoE, TxPDO and RxPDO, master is client (beta).
- FoE, Read and Write file (beta).
Features as of 1.1.4 :
- FMMU allocation is floating instead of fixed. If needed more than 2 FMMUs are used.
- SYNC1 generation supported.
Features as of 1.2.0 :
- Changed license to GPLv2 only. Adresses leagal concerns about master licensing.
- Slave init and process data mapping is split in two functions. This allows dynamic user reconfiguration of PDO mapping.
- Eeprom transfer to and from PDI
- Eeprom is released to PDI when going to SAFEOP.
For examples see
simple_test.c in ~/src. First try (assume EtherCAT on eth0): sudo ./simple_test eth0 As SOEM uses RAW sockets it will need to run as root.
Version 1.1.3
Version 1.1.4
- Changed FMMU algorithm of allocation during configuration. EL4732 supported now.
- Changed the ec_slave structure around SM en FMMU storage.
- Fixed bug in FoE write in ethercatfoe.c
Version 1.2.0
- Fixed bug in type definition of int32 and uint32 for 64bit OS.
- Fixed bug in maximum dataframe size calculation.
Copyright© 2005-2009 Speciaal Machinefabriek Ketels v.o.f.
Copyright© 2005-2009 Arthur Ketels
Copyright© 2008-2009 TU/e Technische Universiteit Eindhoven
SOEM is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
SOEM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
As a special exception, if other files instantiate templates or use macros or inline functions from this file, or you compile this file and link it with other works to produce a work based on this file, this file does not by itself cause the resulting work to be covered by the GNU General Public License. However the source code for this file must still be made available in accordance with section (3) of the GNU General Public License.
This exception does not invalidate any other reasons why a work based on this file might be covered by the GNU General Public License.
The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual property of, and protected by Beckhoff Automation GmbH. You can use SOEM for the sole purpose of creating, using and/or selling or otherwise distributing an EtherCAT network master provided that an EtherCAT Master License is obtained from Beckhoff Automation GmbH.
In case you did not receive a copy of the EtherCAT Master License along with SOEM write to Beckhoff Automation GmbH, Eiserstrasse 5, D-33415 Verl, Germany (www.beckhoff.com).