PySOEM is a Cython wrapper for the Simple Open EtherCAT Master Library (https://github.com/OpenEtherCATsociety/SOEM).
PySOEM enables basic system testing of EtherCAT slave devices with Python.
Features
- input process data read and output process data write
- SDO read and write
- EEPROM read and write
- FoE read and write
Todo
- EoE
Beware that real-time applications need some special considerations.
- Python 3
- Python scripts that use PySOEM must be executed under administrator privileges
| [*] | Make sure you check "Install Npcap in WinPcap API-compatible Mode" during the install |
- Python 3
python -m pip install pysoem
or
pip install pysoem
Consider using a virtualenv.
Although there are some pieces missing, the documentation is hosted on "Read the Docs" at: pysoem.readthedocs.io.
Please also have a look at the examples on GitHub.
Contributions are welcome and highly appreciated!
If you are planning a major API change or intend to submit a large amount of new code, please open an issue or start a discussion first so we can agree on the approach before you begin.
Please follow PEP 8 for Python code style. Using Ruff to format and lint your code before submitting a pull request is recommended.
- Fixes single access to object directory property
obj_access. - Fixes
sdo_read()withrelease_gilparameter beingTrue. - Adds the
release_gilparameter also tosend_overlap_processdata(). - Adds
get_watchdog()to retrieve the watchdog timeout. - Adds the emission of a warning in
set_watchdog()if the actual watchdog timeout differs from the requested timeout. - Binary wheels are now also available for "manylinux" with ARM64/aarch64 on PyPI.
- Binary wheels are now also available for Python 3.14.
- Updates the underlying SOEM to fix segmented io issues
- Fixes issues with Enums on newer Cython versions
- Adds No-GIL support.
- Per global setting
pysoem.settings.always_release_gil. - Per Master instance attribute
always_release_gil. - Per function argument
release_gil.
- Per global setting
- Adds
pysoem.settings.timeoutsto configure low-level timeouts at run-time.
- Adds protection against closed network interface connection.
- Fixes null pointer issues when reading not initialized properties
config_funcandsetup_func.
- Adds
add_emergency_callback()to allow a better handling of emergency messages. - Improves auto-completion.
- Adds working counter check on SDO read and write.
- Fixes issues with
config_init()when it's called multiple times.
- Adds support for redundancy mode,
master.open()provides now an optional second parameter for the redundancy port.
- Fixes Cython compiling issues.
- Adds function
_disable_complete_access()that stops config_map() from using "complete access" for SDO requests.
- Changed the data type for the
nameattribute of SDO info CdefCoeObject and CdefCoeObjectEntry, they are of type bytes now instead of a regular Python 3 string. - Also changed the
descattribute of thefind_adapters()list elements tobytes. - Introduces the
open()context manager function. - Adds the
setup_functhat will maybe later replace theconfig_func.
- Version bump only to re-upload to PyPI with windows-wheel for Python 3.11
- Fix issues with timeouts at
amend_mbxandset_watchdog.
- Introduces
amend_mbxandset_watchdog, though this is rather experimental - New example
firmware_update.py.
- Introduces the
manual_state_changeproperty
- Proper logging
- Introduces
mbx_receive
- Fix the FoE password issue
- Licence change to MIT licence
- Introduces configurable timeouts for SDO read and SDO write
- Improved API docs
- API change: remove the size parameter for
foe_write - Introduces overlap map support
- No Cython required to install the package from the source distribution
- Introduces FoE
- Update of the underlying SOEM
- Fixes bug when Ibytes = 0 and Ibits > 0
- Exposes ec_DCtime (
dc_time) for DC synchronization
- Improvement on SDO Aborts
- SDO info read
- Readme update only
- Initial publication