ethercat-master 0.1.9__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ethercat_master-0.2.0/.github/workflows/release.yml +150 -0
- ethercat_master-0.2.0/.gitignore +55 -0
- ethercat_master-0.2.0/AGENTS.md +45 -0
- ethercat_master-0.2.0/CMakeLists.txt +10 -0
- ethercat_master-0.2.0/LICENSE +674 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/PKG-INFO +378 -370
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/README.md +342 -336
- ethercat_master-0.2.0/benchmarks/__init__.py +0 -0
- ethercat_master-0.2.0/benchmarks/common.py +57 -0
- ethercat_master-0.2.0/benchmarks/pdo_loop.py +79 -0
- ethercat_master-0.2.0/benchmarks/thread_isolation_effect.py +88 -0
- ethercat_master-0.2.0/benchmarks/timer_resolution_effect.py +52 -0
- ethercat_master-0.2.0/benchmarks/timing_precision.py +50 -0
- ethercat_master-0.2.0/ci/make_wheel.py +102 -0
- ethercat_master-0.2.0/ci/mingw-toolchain.cmake +13 -0
- ethercat_master-0.2.0/csrc/ecm.c +258 -0
- ethercat_master-0.2.0/docs/images/01-bus-overview.png +0 -0
- ethercat_master-0.2.0/docs/images/02-network-test.png +0 -0
- ethercat_master-0.2.0/docs/images/03-bus-discovery-mixed.png +0 -0
- ethercat_master-0.2.0/docs/web-interface.md +93 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/__init__.py +9 -2
- ethercat_master-0.2.0/ethercat_master/_backend.py +11 -0
- ethercat_master-0.2.0/ethercat_master/_soem.py +620 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/bus.py +1651 -1514
- ethercat_master-0.2.0/ethercat_master/webgui/index.html +440 -0
- ethercat_master-0.2.0/ethercat_master/webgui/style.css +179 -0
- ethercat_master-0.2.0/examples/beckhoff.py +55 -0
- ethercat_master-0.2.0/examples/discover.py +33 -0
- ethercat_master-0.2.0/examples/mixed_bus.py +48 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/pyproject.toml +64 -66
- ethercat_master-0.2.0/tests/__init__.py +0 -0
- ethercat_master-0.2.0/tests/test_bus.py +414 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/tests/test_pdo.py +58 -58
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/tests/test_slave.py +22 -22
- ethercat_master-0.2.0/third_party/SOEM/.clang-format +26 -0
- ethercat_master-0.2.0/third_party/SOEM/CMakeLists.txt +191 -0
- ethercat_master-0.2.0/third_party/SOEM/CMakePresets.json +39 -0
- ethercat_master-0.2.0/third_party/SOEM/LICENSE.md +25 -0
- ethercat_master-0.2.0/third_party/SOEM/README.md +29 -0
- ethercat_master-0.2.0/third_party/SOEM/cmake/AddENI.cmake +39 -0
- ethercat_master-0.2.0/third_party/SOEM/cmake/Linux.cmake +43 -0
- ethercat_master-0.2.0/third_party/SOEM/cmake/Windows.cmake +75 -0
- ethercat_master-0.2.0/third_party/SOEM/cmake/rt-kernel.cmake +52 -0
- ethercat_master-0.2.0/third_party/SOEM/cmake/tools/FindSphinx.cmake +16 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/cmake/Modules/Platform/rtems.cmake +22 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/cmake/rtems.cmake +34 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/erika/README.md +4 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/erika/osal.c +106 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/erika/osal_defs.h +42 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/intime/osal.c +89 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/intime/osal_defs.h +44 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/macosx/osal.c +147 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/macosx/osal_defs.h +39 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/rtems/osal.c +147 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/rtems/osal_defs.h +39 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/vxworks/osal.c +188 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/osal/vxworks/osal_defs.h +30 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/erika/nicdrv.c +541 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/erika/nicdrv.h +107 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/erika/oshw.c +82 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/erika/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/intime/nicdrv.c +695 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/intime/nicdrv.h +117 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/intime/oshw.c +48 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/intime/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/macosx/nicdrv.c +597 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/macosx/nicdrv.h +106 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/macosx/oshw.c +117 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/macosx/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/rtems/nicdrv.c +657 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/rtems/nicdrv.h +106 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/rtems/oshw.c +117 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/rtems/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/vxworks/nicdrv.c +930 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/vxworks/nicdrv.h +116 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/vxworks/oshw.c +61 -0
- ethercat_master-0.2.0/third_party/SOEM/contrib/oshw/vxworks/oshw.h +23 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_base.h +42 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_coe.h +73 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_config.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_dc.h +27 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_eoe.h +217 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_foe.h +27 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_main.h +627 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_options.h.in +128 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_print.h +30 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_soe.h +121 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/ec_type.h +571 -0
- ethercat_master-0.2.0/third_party/SOEM/include/soem/soem.h +28 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/linux/osal.c +154 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/linux/osal_defs.h +46 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/osal.h +222 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/rtk/osal.c +109 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/rtk/osal_defs.h +45 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/win32/osal.c +176 -0
- ethercat_master-0.2.0/third_party/SOEM/osal/win32/osal_defs.h +51 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/linux/nicdrv.c +639 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/linux/nicdrv.h +108 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/linux/oshw.c +116 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/linux/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/rtk/nicdrv.c +589 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/rtk/nicdrv.h +100 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/rtk/oshw.c +54 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/rtk/oshw.h +37 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/nicdrv.c +602 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/nicdrv.h +111 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/oshw.c +120 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/oshw.h +31 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/Packet32.h +359 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/Win32-Extensions.h +113 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/bittypes.h +137 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/ip6_misc.h +163 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/bluetooth.h +48 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/bpf.h +934 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/namedb.h +89 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/pcap.h +407 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/sll.h +129 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/usb.h +90 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap/vlan.h +46 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap-bpf.h +47 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap-namedb.h +42 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap-stdinc.h +93 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/pcap.h +45 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Include/remote-ext.h +444 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/Packet.lib +0 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/libpacket.a +0 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/libwpcap.a +0 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/wpcap.lib +0 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/x64/Packet.lib +0 -0
- ethercat_master-0.2.0/third_party/SOEM/oshw/win32/wpcap/Lib/x64/wpcap.lib +0 -0
- ethercat_master-0.2.0/third_party/SOEM/scripts/eniconv.py +231 -0
- ethercat_master-0.2.0/third_party/SOEM/soem.spdx +19 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_base.c +534 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_coe.c +1437 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_config.c +1735 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_dc.c +428 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_eoe.c +701 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_foe.c +460 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_main.c +2798 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_print.c +378 -0
- ethercat_master-0.2.0/third_party/SOEM/src/ec_soe.c +401 -0
- ethercat_master-0.1.9/ethercat_master/webgui/index.html +0 -430
- ethercat_master-0.1.9/ethercat_master/webgui/style.css +0 -57
- ethercat_master-0.1.9/ethercat_master.egg-info/PKG-INFO +0 -370
- ethercat_master-0.1.9/ethercat_master.egg-info/SOURCES.txt +0 -21
- ethercat_master-0.1.9/ethercat_master.egg-info/dependency_links.txt +0 -1
- ethercat_master-0.1.9/ethercat_master.egg-info/entry_points.txt +0 -2
- ethercat_master-0.1.9/ethercat_master.egg-info/requires.txt +0 -7
- ethercat_master-0.1.9/ethercat_master.egg-info/top_level.txt +0 -1
- ethercat_master-0.1.9/setup.cfg +0 -4
- ethercat_master-0.1.9/tests/test_bus.py +0 -199
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/ethercat_config.json +0 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/exceptions.py +0 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/network_test.py +0 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/pdo.py +0 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/slave.py +0 -0
- {ethercat_master-0.1.9 → ethercat_master-0.2.0}/ethercat_master/webserver.py +0 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# Builds the SOEM shim for Linux + Windows, runs tests, packages the
|
|
2
|
+
# wheel/sdist and publishes to PyPI on version tags via trusted publishing
|
|
3
|
+
# (OIDC — no API token needed).
|
|
4
|
+
#
|
|
5
|
+
# PyPI setup (once, on pypi.org -> Publishing -> GitHub):
|
|
6
|
+
# owner = henschel-robotics, repository = python-ethercat-master,
|
|
7
|
+
# workflow filename = release.yml, environment = pypi
|
|
8
|
+
# Fallback without OIDC: create a repository secret PYPI_API_TOKEN and replace
|
|
9
|
+
# the gh-action-pypi-publish step with
|
|
10
|
+
# - run: pip install twine && twine upload --non-interactive -u __token__ -p "$PYPI_API_TOKEN" dist/*
|
|
11
|
+
# env: { PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }} }
|
|
12
|
+
|
|
13
|
+
name: release
|
|
14
|
+
|
|
15
|
+
on:
|
|
16
|
+
push:
|
|
17
|
+
tags: ["v*", "[0-9]*.[0-9]*.[0-9]*"]
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
env:
|
|
21
|
+
LLVM_MINGW_VERSION: "20261117"
|
|
22
|
+
LLVM_MINGW_DIR: "llvm-mingw-20261117-ucrt-ubuntu-22.04-x86_64"
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
# Compiles libecm.so (host gcc) and libecm.dll (llvm-mingw cross-compile).
|
|
26
|
+
natives:
|
|
27
|
+
runs-on: ubuntu-latest
|
|
28
|
+
steps:
|
|
29
|
+
- uses: actions/checkout@v4
|
|
30
|
+
|
|
31
|
+
- uses: actions/setup-python@v5
|
|
32
|
+
with:
|
|
33
|
+
python-version: "3.12"
|
|
34
|
+
|
|
35
|
+
- run: pip install --quiet cmake ninja
|
|
36
|
+
|
|
37
|
+
- name: Install llvm-mingw
|
|
38
|
+
run: |
|
|
39
|
+
curl -fsSL "https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/${LLVM_MINGW_DIR}.tar.xz" | sudo tar -xJ -C /opt
|
|
40
|
+
echo "/opt/${LLVM_MINGW_DIR}/bin" >> "$GITHUB_PATH"
|
|
41
|
+
|
|
42
|
+
- name: Build libecm.so (Linux)
|
|
43
|
+
run: |
|
|
44
|
+
cmake -B build-linux -G Ninja -DCMAKE_BUILD_TYPE=Release
|
|
45
|
+
cmake --build build-linux --target ecm
|
|
46
|
+
cp build-linux/libecm.so ethercat_master/
|
|
47
|
+
|
|
48
|
+
- name: Build libecm.dll (Windows cross-compile)
|
|
49
|
+
run: |
|
|
50
|
+
cmake -B build-win -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=ci/mingw-toolchain.cmake
|
|
51
|
+
cmake --build build-win --target ecm
|
|
52
|
+
cp build-win/libecm.dll ethercat_master/
|
|
53
|
+
|
|
54
|
+
- uses: actions/upload-artifact@v4
|
|
55
|
+
with:
|
|
56
|
+
name: natives
|
|
57
|
+
path: |
|
|
58
|
+
ethercat_master/libecm.so
|
|
59
|
+
ethercat_master/libecm.dll
|
|
60
|
+
retention-days: 7
|
|
61
|
+
|
|
62
|
+
# Editable install rebuilds the shim for the host, then run the test suite.
|
|
63
|
+
test:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
|
|
68
|
+
- uses: actions/setup-python@v5
|
|
69
|
+
with:
|
|
70
|
+
python-version: "3.12"
|
|
71
|
+
|
|
72
|
+
- run: pip install --quiet -e .[dev]
|
|
73
|
+
|
|
74
|
+
- run: python -m pytest tests -q
|
|
75
|
+
|
|
76
|
+
# Reports lint findings without blocking the release. Broad `except
|
|
77
|
+
# Exception:` blocks and the mutable _AL_STATUS_CODES dict are intentional
|
|
78
|
+
# for fault tolerance — see AGENTS.md.
|
|
79
|
+
lint:
|
|
80
|
+
runs-on: ubuntu-latest
|
|
81
|
+
continue-on-error: true
|
|
82
|
+
steps:
|
|
83
|
+
- uses: actions/checkout@v4
|
|
84
|
+
|
|
85
|
+
- uses: actions/setup-python@v5
|
|
86
|
+
with:
|
|
87
|
+
python-version: "3.12"
|
|
88
|
+
|
|
89
|
+
- run: pip install --quiet ruff
|
|
90
|
+
|
|
91
|
+
- run: ruff check ethercat_master tests benchmarks
|
|
92
|
+
|
|
93
|
+
# One universal wheel: it ships libecm.so + libecm.dll and _soem picks the
|
|
94
|
+
# right one per platform. The sdist includes csrc/ + third_party/SOEM.
|
|
95
|
+
package:
|
|
96
|
+
runs-on: ubuntu-latest
|
|
97
|
+
needs: [natives, test]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/checkout@v4
|
|
100
|
+
|
|
101
|
+
- uses: actions/setup-python@v5
|
|
102
|
+
with:
|
|
103
|
+
python-version: "3.12"
|
|
104
|
+
|
|
105
|
+
- uses: actions/download-artifact@v4
|
|
106
|
+
with:
|
|
107
|
+
name: natives
|
|
108
|
+
path: ethercat_master/
|
|
109
|
+
|
|
110
|
+
- run: pip install --quiet build
|
|
111
|
+
|
|
112
|
+
- run: python ci/make_wheel.py
|
|
113
|
+
|
|
114
|
+
- run: python -m build --sdist --outdir dist
|
|
115
|
+
|
|
116
|
+
- uses: actions/upload-artifact@v4
|
|
117
|
+
with:
|
|
118
|
+
name: dist
|
|
119
|
+
path: dist/
|
|
120
|
+
retention-days: 7
|
|
121
|
+
|
|
122
|
+
# Publish on version tags (v0.2.0 / 0.2.0 must match project.version).
|
|
123
|
+
publish:
|
|
124
|
+
runs-on: ubuntu-latest
|
|
125
|
+
needs: package
|
|
126
|
+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
|
|
127
|
+
environment: pypi
|
|
128
|
+
permissions:
|
|
129
|
+
id-token: write
|
|
130
|
+
steps:
|
|
131
|
+
- uses: actions/checkout@v4
|
|
132
|
+
|
|
133
|
+
- uses: actions/setup-python@v5
|
|
134
|
+
with:
|
|
135
|
+
python-version: "3.12"
|
|
136
|
+
|
|
137
|
+
- uses: actions/download-artifact@v4
|
|
138
|
+
with:
|
|
139
|
+
name: dist
|
|
140
|
+
path: dist/
|
|
141
|
+
|
|
142
|
+
- name: Check tag matches project.version
|
|
143
|
+
run: |
|
|
144
|
+
V=$(python -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
145
|
+
if [ "${GITHUB_REF_NAME#v}" != "$V" ]; then
|
|
146
|
+
echo "Tag '$GITHUB_REF_NAME' does not match pyproject version '$V'" >&2
|
|
147
|
+
exit 1
|
|
148
|
+
fi
|
|
149
|
+
|
|
150
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.egg-info/
|
|
5
|
+
*.egg
|
|
6
|
+
.eggs/
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
.pytest_cache/
|
|
10
|
+
.ruff_cache/
|
|
11
|
+
.mypy_cache/
|
|
12
|
+
.coverage
|
|
13
|
+
htmlcov/
|
|
14
|
+
|
|
15
|
+
# Packaging (build, scikit-build-core, cibuildwheel)
|
|
16
|
+
dist/
|
|
17
|
+
build/
|
|
18
|
+
build-*/
|
|
19
|
+
_skbuild/
|
|
20
|
+
wheelhouse/
|
|
21
|
+
|
|
22
|
+
# Local llvm-mingw toolchain (see .github/workflows/release.yml)
|
|
23
|
+
.llvm-mingw/
|
|
24
|
+
|
|
25
|
+
# CMake
|
|
26
|
+
CMakeCache.txt
|
|
27
|
+
CMakeFiles/
|
|
28
|
+
CMakeUserPresets.json
|
|
29
|
+
cmake-build-*/
|
|
30
|
+
cmake_install.cmake
|
|
31
|
+
compile_commands.json
|
|
32
|
+
|
|
33
|
+
# Built SOEM shim and native artifacts
|
|
34
|
+
ethercat_master/libecm.*
|
|
35
|
+
ethercat_master/ecm.*
|
|
36
|
+
*.o
|
|
37
|
+
*.obj
|
|
38
|
+
*.a
|
|
39
|
+
*.lib
|
|
40
|
+
*.exp
|
|
41
|
+
*.pdb
|
|
42
|
+
*.ilk
|
|
43
|
+
*.so
|
|
44
|
+
*.dylib
|
|
45
|
+
*.dll
|
|
46
|
+
# SOEM ships the wpcap import libraries needed for the Windows build
|
|
47
|
+
!third_party/SOEM/oshw/win32/wpcap/**
|
|
48
|
+
|
|
49
|
+
# IDEs / OS
|
|
50
|
+
.vs/
|
|
51
|
+
.vscode/
|
|
52
|
+
.idea/
|
|
53
|
+
*.swp
|
|
54
|
+
.DS_Store
|
|
55
|
+
Thumbs.db
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Agent Notes — python-ethercat-master
|
|
2
|
+
|
|
3
|
+
## Verification commands
|
|
4
|
+
|
|
5
|
+
Run tests:
|
|
6
|
+
```bash
|
|
7
|
+
python -m pytest tests -q
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
Lint (new/modified files):
|
|
11
|
+
```bash
|
|
12
|
+
ruff check ethercat_master tests benchmarks
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Build package:
|
|
16
|
+
```bash
|
|
17
|
+
python -m build
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Install development dependencies:
|
|
21
|
+
```bash
|
|
22
|
+
pip install -e .[dev]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Benchmarks
|
|
26
|
+
|
|
27
|
+
Micro-benchmark timing policies without hardware:
|
|
28
|
+
```bash
|
|
29
|
+
python -m benchmarks.timing_precision --cycle-ms 0.7 --iterations 2000 --policy precise
|
|
30
|
+
python -m benchmarks.timing_precision --cycle-ms 0.7 --iterations 2000 --policy balanced
|
|
31
|
+
python -m benchmarks.timing_precision --cycle-ms 0.7 --iterations 2000 --policy low_cpu
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Full PDO loop benchmark on real hardware:
|
|
35
|
+
```bash
|
|
36
|
+
python -m benchmarks.pdo_loop --adapter "\\Device\\NPF_{...}" --cycle-ms 0.7 --duration 10
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Notes
|
|
40
|
+
|
|
41
|
+
- Sub-millisecond cycles rely on the `precise` timing policy (busy-yield). The `balanced` policy reduces CPU for cycles > ~2 ms but is still close to `precise` for sub-ms. `low_cpu` is only suitable when jitter requirements are relaxed or cycle times are well above the OS timer resolution.
|
|
42
|
+
- `EtherCATBus` now accepts `timing_stats=True` to collect per-loop timing statistics and `timing_policy="precise|balanced|low_cpu"`.
|
|
43
|
+
- `open()` and `_attempt_reconnect()` share `_bring_up()` (`_configure_pdos` → `_map_io` → SAFE-OP → `_configure_dc` → `_reach_op`). Subclass and override a step for device quirks instead of monkey-patching. Opt-in constructor options: `dc_sync0_cycle_ns`, `op_attempts`/`op_timeout_s`, `sdo_read_timeout_us`/`sdo_write_timeout_us`, `config_map_error_filter`, `reconnect_lock`, `on_connection_lost`/`on_reconnected`. Defaults preserve the previous behaviour.
|
|
44
|
+
- After (re)connect `bus.settled` is set once all slaves ran clean in OP for `settle_time_s`; applications should hold non-essential SDO traffic until then (blocking SDO calls stall the ProcessData thread and trip SM watchdogs). The state-check loop ignores SAFE-OP(+ERROR) recoveries within `recover_grace_s` of the last OP sighting.
|
|
45
|
+
- `ruff` still reports pre-existing broad `except Exception:` blocks and a mutable `_AL_STATUS_CODES` class dict; these were intentionally left unchanged to preserve existing fault-tolerance behavior.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
cmake_minimum_required(VERSION 3.16)
|
|
2
|
+
project(ecm C)
|
|
3
|
+
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
4
|
+
set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
|
|
5
|
+
set(SOEM_BUILD_SAMPLES OFF CACHE BOOL "" FORCE)
|
|
6
|
+
add_subdirectory(third_party/SOEM)
|
|
7
|
+
add_library(ecm SHARED csrc/ecm.c)
|
|
8
|
+
set_target_properties(ecm PROPERTIES C_VISIBILITY_PRESET hidden PREFIX "lib")
|
|
9
|
+
target_link_libraries(ecm PRIVATE soem)
|
|
10
|
+
install(TARGETS ecm LIBRARY DESTINATION ethercat_master RUNTIME DESTINATION ethercat_master)
|