An EtherCAT MainDevice in Python, fully free and open source.
Priority | Goal | Status |
---|---|---|
1 | Fully functional and complete python bindings for the Simple Open EtherCAT Master SOEM (originally written in C) using nanobind | work in progress |
2 | Configuration of the MainDevice and SubDevices via an EtherCAT Network Information (ENI) file. | not started |
3 | Software-in-the-loop (SiL) network simulation capability. | not started |
4 | Async API. | not started |
This library is extremely early in development.
We will follow semantic versioning. Expect drastic changes to the API prior to v1.0.0.
Windows / Mac OSX compatibility is intended for developer convenience only. The intended targets are linux with PREEMPT_RT patches. Typically, the easiest to work with is Debian since pre-compiled patches are available from the repositories.
pip install pyecm
Windows requires installation of an additional dependency npcap. https://npcap.com/
Please install it in winpcap compatibility mode (I believe this is the default configuration.)
On a typical windows system:
C:\repos\pyecm>python examples/soem/simple_test.py --ifname "\Device\NPF_{6F17F41B-E756-4470-B7B8-74A3504B4F7B}"
will output something like:
C:\repos\pyecm>python examples/soem/simple_test.py --ifname "\Device\NPF_{6F17F41B-E756-4470-B7B8-74A3504B4F7B}"
simple_test.py args=Namespace(ifname='\\Device\\NPF_{6F17F41B-E756-4470-B7B8-74A3504B4F7B}', if2name=None)
ecx_init succeeded.
found 5 subdevices:
network summary:
position|configadr|aliasadr|name ---|manufacturer|product|revision
0|main device
1|0x1001 |0x0 |EK1100 |0x2 |0x44c2c52 |0x100000
2|0x1002 |0x0 |EL3314 |0x2 |0xcf23052 |0x120000
3|0x1003 |0x0 |EL2088 |0x2 |0x8283052 |0x110000
4|0x1004 |0x0 |EL3681 |0x2 |0xe613052 |0x120000
5|0x1005 |0x0 |EL3204 |0x2 |0xc843052 |0x110000
reached state: 2
successfully configured iomap. iomap size: 66
distrubuted clocks configured
reached state: 4
reached state: OPERATIONAL
started main operation
iomap: [0 0 0 ... 0 0 0]
-
clone repo (and submodules)
use
git clone <repo clone url> --recursive
-
install vscode
-
install docker desktop
-
install vscode dev containers extension
-
open vscode in repo
-
click reopen in container
-
open new terminal
-
run
pip install . && pytest