yrcom 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.
- yrcom-0.2.0/LICENSE +21 -0
- yrcom-0.2.0/PKG-INFO +112 -0
- yrcom-0.2.0/README.md +96 -0
- yrcom-0.2.0/pyproject.toml +30 -0
- yrcom-0.2.0/setup.cfg +4 -0
- yrcom-0.2.0/src/yrcom/__init__.py +48 -0
- yrcom-0.2.0/src/yrcom/hses_client.py +1659 -0
- yrcom-0.2.0/src/yrcom/hses_errors.py +190 -0
- yrcom-0.2.0/src/yrcom/hses_file.py +234 -0
- yrcom-0.2.0/src/yrcom/hses_sim.py +173 -0
- yrcom-0.2.0/src/yrcom/robot_connection.py +434 -0
- yrcom-0.2.0/src/yrcom/yaskawa_client.py +615 -0
- yrcom-0.2.0/src/yrcom.egg-info/PKG-INFO +112 -0
- yrcom-0.2.0/src/yrcom.egg-info/SOURCES.txt +22 -0
- yrcom-0.2.0/src/yrcom.egg-info/dependency_links.txt +1 -0
- yrcom-0.2.0/src/yrcom.egg-info/entry_points.txt +2 -0
- yrcom-0.2.0/src/yrcom.egg-info/requires.txt +3 -0
- yrcom-0.2.0/src/yrcom.egg-info/top_level.txt +1 -0
- yrcom-0.2.0/tests/test_hses_client.py +1082 -0
- yrcom-0.2.0/tests/test_hses_file.py +300 -0
- yrcom-0.2.0/tests/test_hses_sim.py +71 -0
- yrcom-0.2.0/tests/test_robot_connection.py +232 -0
- yrcom-0.2.0/tests/test_yaskawa_client.py +237 -0
- yrcom-0.2.0/tests/test_yaskawa_commands.py +217 -0
yrcom-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 cmosbk
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
yrcom-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yrcom
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Yaskawa robot communication — Ethernet Server, HSES and HSES File Control (pure stdlib)
|
|
5
|
+
Author: cmosbk
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/CMOSBK/yrcom
|
|
8
|
+
Project-URL: Issues, https://github.com/CMOSBK/yrcom/issues
|
|
9
|
+
Keywords: yaskawa,robot,hses,ethernet-server,motoman,yrc1000
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Provides-Extra: dev
|
|
14
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# yrcom
|
|
18
|
+
|
|
19
|
+
[](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml)
|
|
20
|
+
|
|
21
|
+
Yaskawa robot communication as a standalone Python library — a single,
|
|
22
|
+
hardware-verified communication core meant to be shared across projects
|
|
23
|
+
instead of being duplicated.
|
|
24
|
+
|
|
25
|
+
The name: **YRC** (Yaskawa Robot Controller, e.g. YRC1000) + **COM**munication.
|
|
26
|
+
|
|
27
|
+
**Pure stdlib** — no runtime dependencies. Import name: `yrcom`.
|
|
28
|
+
|
|
29
|
+
## Transports
|
|
30
|
+
|
|
31
|
+
| Class | Transport | Purpose |
|
|
32
|
+
|---|---|---|
|
|
33
|
+
| `YaskawaClient` | Ethernet Server, TCP 80 | classic host-control commands |
|
|
34
|
+
| `HsesClient` | HSES, UDP 10040 | high speed: 45 commands (status, alarms, variables, IO, telemetry, motion) |
|
|
35
|
+
| `HsesFileClient` | HSES File Control, UDP 10041 | read/write job files, file list, CMOS backup |
|
|
36
|
+
| `RobotConnection` | ES + HSES behind one IP | pick the transport via `transport="hses"\|"ethernet"` |
|
|
37
|
+
| `HsesReplayServer` | — (testing) | replays a recorded robot session as a UDP server → offline development/testing |
|
|
38
|
+
|
|
39
|
+
Command coverage: HSES Robot Control **45/45**, File Control **5/5**
|
|
40
|
+
(verified against real hardware: YRC1000, SW YAS5.40).
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install yrcom # from PyPI
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
For development:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pip install -e ".[dev]" # editable install incl. pytest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Quick start
|
|
55
|
+
|
|
56
|
+
```python
|
|
57
|
+
from yrcom import HsesClient
|
|
58
|
+
|
|
59
|
+
c = HsesClient("192.0.2.10") # UDP 10040
|
|
60
|
+
c.open()
|
|
61
|
+
print(c.read_status()) # {'servo_on': False, 'teach': True, ...}
|
|
62
|
+
print(c.read_d_var(0)) # D[0]
|
|
63
|
+
c.close()
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Transport-agnostic via `RobotConnection`:
|
|
67
|
+
|
|
68
|
+
```python
|
|
69
|
+
from yrcom import RobotConnection
|
|
70
|
+
|
|
71
|
+
rc = RobotConnection("192.0.2.10", transport="hses")
|
|
72
|
+
rc.connect()
|
|
73
|
+
print(rc.status()) # same keys, whether HSES or ES
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Offline: the replay simulator
|
|
77
|
+
|
|
78
|
+
Record a controller's real responses as JSON (tx/rx pairs per command, see
|
|
79
|
+
`tests/fixtures/sample_capture.json` for the format) and replay them — the
|
|
80
|
+
real `HsesClient` talks to the simulator:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
from yrcom import HsesReplayServer, HsesClient
|
|
84
|
+
|
|
85
|
+
with HsesReplayServer.from_capture("capture.json") as srv:
|
|
86
|
+
c = HsesClient("127.0.0.1", srv.port); c.open()
|
|
87
|
+
print(c.read_status()) # recorded response, no robot needed
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Or as a standalone server: `python -m yrcom.hses_sim capture.json --port 10040`.
|
|
91
|
+
|
|
92
|
+
## Legal
|
|
93
|
+
|
|
94
|
+
Independent community project, not affiliated with or endorsed by Yaskawa.
|
|
95
|
+
*Yaskawa*, *Motoman* and *YRC1000* are trademarks of Yaskawa Electric
|
|
96
|
+
Corporation and are used here descriptively (compatibility) only. The
|
|
97
|
+
implementation is based on the publicly available protocol manuals
|
|
98
|
+
(HW0483202, HW1483358).
|
|
99
|
+
|
|
100
|
+
## Tests
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pytest
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
The tests run **without a robot**: a stateful ES mock (`tests/mock_robot.py`)
|
|
108
|
+
and a small HSES capture fixture (`tests/fixtures/`).
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT — see [LICENSE](LICENSE).
|
yrcom-0.2.0/README.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# yrcom
|
|
2
|
+
|
|
3
|
+
[](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
Yaskawa robot communication as a standalone Python library — a single,
|
|
6
|
+
hardware-verified communication core meant to be shared across projects
|
|
7
|
+
instead of being duplicated.
|
|
8
|
+
|
|
9
|
+
The name: **YRC** (Yaskawa Robot Controller, e.g. YRC1000) + **COM**munication.
|
|
10
|
+
|
|
11
|
+
**Pure stdlib** — no runtime dependencies. Import name: `yrcom`.
|
|
12
|
+
|
|
13
|
+
## Transports
|
|
14
|
+
|
|
15
|
+
| Class | Transport | Purpose |
|
|
16
|
+
|---|---|---|
|
|
17
|
+
| `YaskawaClient` | Ethernet Server, TCP 80 | classic host-control commands |
|
|
18
|
+
| `HsesClient` | HSES, UDP 10040 | high speed: 45 commands (status, alarms, variables, IO, telemetry, motion) |
|
|
19
|
+
| `HsesFileClient` | HSES File Control, UDP 10041 | read/write job files, file list, CMOS backup |
|
|
20
|
+
| `RobotConnection` | ES + HSES behind one IP | pick the transport via `transport="hses"\|"ethernet"` |
|
|
21
|
+
| `HsesReplayServer` | — (testing) | replays a recorded robot session as a UDP server → offline development/testing |
|
|
22
|
+
|
|
23
|
+
Command coverage: HSES Robot Control **45/45**, File Control **5/5**
|
|
24
|
+
(verified against real hardware: YRC1000, SW YAS5.40).
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
pip install yrcom # from PyPI
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For development:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install -e ".[dev]" # editable install incl. pytest
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Quick start
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
from yrcom import HsesClient
|
|
42
|
+
|
|
43
|
+
c = HsesClient("192.0.2.10") # UDP 10040
|
|
44
|
+
c.open()
|
|
45
|
+
print(c.read_status()) # {'servo_on': False, 'teach': True, ...}
|
|
46
|
+
print(c.read_d_var(0)) # D[0]
|
|
47
|
+
c.close()
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Transport-agnostic via `RobotConnection`:
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
from yrcom import RobotConnection
|
|
54
|
+
|
|
55
|
+
rc = RobotConnection("192.0.2.10", transport="hses")
|
|
56
|
+
rc.connect()
|
|
57
|
+
print(rc.status()) # same keys, whether HSES or ES
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Offline: the replay simulator
|
|
61
|
+
|
|
62
|
+
Record a controller's real responses as JSON (tx/rx pairs per command, see
|
|
63
|
+
`tests/fixtures/sample_capture.json` for the format) and replay them — the
|
|
64
|
+
real `HsesClient` talks to the simulator:
|
|
65
|
+
|
|
66
|
+
```python
|
|
67
|
+
from yrcom import HsesReplayServer, HsesClient
|
|
68
|
+
|
|
69
|
+
with HsesReplayServer.from_capture("capture.json") as srv:
|
|
70
|
+
c = HsesClient("127.0.0.1", srv.port); c.open()
|
|
71
|
+
print(c.read_status()) # recorded response, no robot needed
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or as a standalone server: `python -m yrcom.hses_sim capture.json --port 10040`.
|
|
75
|
+
|
|
76
|
+
## Legal
|
|
77
|
+
|
|
78
|
+
Independent community project, not affiliated with or endorsed by Yaskawa.
|
|
79
|
+
*Yaskawa*, *Motoman* and *YRC1000* are trademarks of Yaskawa Electric
|
|
80
|
+
Corporation and are used here descriptively (compatibility) only. The
|
|
81
|
+
implementation is based on the publicly available protocol manuals
|
|
82
|
+
(HW0483202, HW1483358).
|
|
83
|
+
|
|
84
|
+
## Tests
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
pip install -e ".[dev]"
|
|
88
|
+
pytest
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
The tests run **without a robot**: a stateful ES mock (`tests/mock_robot.py`)
|
|
92
|
+
and a small HSES capture fixture (`tests/fixtures/`).
|
|
93
|
+
|
|
94
|
+
## License
|
|
95
|
+
|
|
96
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "yrcom"
|
|
7
|
+
version = "0.2.0"
|
|
8
|
+
description = "Yaskawa robot communication — Ethernet Server, HSES and HSES File Control (pure stdlib)"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.11"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [{ name = "cmosbk" }]
|
|
13
|
+
keywords = ["yaskawa", "robot", "hses", "ethernet-server", "motoman", "yrc1000"]
|
|
14
|
+
dependencies = []
|
|
15
|
+
|
|
16
|
+
[project.optional-dependencies]
|
|
17
|
+
dev = ["pytest>=8"]
|
|
18
|
+
|
|
19
|
+
[project.scripts]
|
|
20
|
+
yrcom-sim = "yrcom.hses_sim:_main"
|
|
21
|
+
|
|
22
|
+
[tool.setuptools.packages.find]
|
|
23
|
+
where = ["src"]
|
|
24
|
+
|
|
25
|
+
[tool.pytest.ini_options]
|
|
26
|
+
testpaths = ["tests"]
|
|
27
|
+
|
|
28
|
+
[project.urls]
|
|
29
|
+
Homepage = "https://github.com/CMOSBK/yrcom"
|
|
30
|
+
Issues = "https://github.com/CMOSBK/yrcom/issues"
|
yrcom-0.2.0/setup.cfg
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"""yrcom — Yaskawa robot communication (Ethernet Server + HSES + File Control).
|
|
2
|
+
|
|
3
|
+
Pure-stdlib library. Three transports under one roof:
|
|
4
|
+
|
|
5
|
+
- `YaskawaClient` — classic Ethernet Server (TCP 80, host-control commands)
|
|
6
|
+
- `HsesClient` — High Speed Ethernet Server (UDP 10040, 45 commands)
|
|
7
|
+
- `HsesFileClient` — HSES File Control (UDP 10041, read/write job files)
|
|
8
|
+
- `RobotConnection` — bundles ES + HSES behind one IP, selectable via `transport`
|
|
9
|
+
- `HsesReplayServer`— replays a recorded session as a UDP server (offline dev/testing)
|
|
10
|
+
"""
|
|
11
|
+
from .yaskawa_client import VarType, YaskawaClient, EthernetServerClient
|
|
12
|
+
from .hses_client import (
|
|
13
|
+
HsesClient,
|
|
14
|
+
HsesError,
|
|
15
|
+
PositionVar,
|
|
16
|
+
AxisPositionVar,
|
|
17
|
+
CartesianMove,
|
|
18
|
+
PulseMove,
|
|
19
|
+
MODEL_DX100,
|
|
20
|
+
MODEL_DX200,
|
|
21
|
+
MODEL_YRC1000,
|
|
22
|
+
)
|
|
23
|
+
from .hses_errors import status_text, added_status_text
|
|
24
|
+
from .hses_file import HsesFileClient, HSES_FILE_PORT
|
|
25
|
+
from .robot_connection import (
|
|
26
|
+
RobotConnection,
|
|
27
|
+
PersistentTcpClient,
|
|
28
|
+
HsesWriteBlockedError,
|
|
29
|
+
TRANSPORT_HSES,
|
|
30
|
+
TRANSPORT_ETHERNET,
|
|
31
|
+
HSES_PORT,
|
|
32
|
+
TCP_PORT,
|
|
33
|
+
)
|
|
34
|
+
from .hses_sim import HsesReplayServer
|
|
35
|
+
|
|
36
|
+
__version__ = "0.2.0"
|
|
37
|
+
|
|
38
|
+
__all__ = [
|
|
39
|
+
"YaskawaClient", "VarType", "EthernetServerClient",
|
|
40
|
+
"HsesClient", "HsesError",
|
|
41
|
+
"PositionVar", "AxisPositionVar", "CartesianMove", "PulseMove",
|
|
42
|
+
"MODEL_DX100", "MODEL_DX200", "MODEL_YRC1000",
|
|
43
|
+
"status_text", "added_status_text",
|
|
44
|
+
"HsesFileClient", "HSES_FILE_PORT",
|
|
45
|
+
"RobotConnection", "PersistentTcpClient", "HsesWriteBlockedError",
|
|
46
|
+
"TRANSPORT_HSES", "TRANSPORT_ETHERNET", "HSES_PORT", "TCP_PORT",
|
|
47
|
+
"HsesReplayServer",
|
|
48
|
+
]
|