yrcom 0.3.0__tar.gz → 0.3.1__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.
Files changed (27) hide show
  1. {yrcom-0.3.0/src/yrcom.egg-info → yrcom-0.3.1}/PKG-INFO +10 -1
  2. {yrcom-0.3.0 → yrcom-0.3.1}/README.md +4 -0
  3. {yrcom-0.3.0 → yrcom-0.3.1}/pyproject.toml +2 -1
  4. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/__init__.py +1 -1
  5. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/hses_client.py +21 -1
  6. {yrcom-0.3.0 → yrcom-0.3.1/src/yrcom.egg-info}/PKG-INFO +10 -1
  7. yrcom-0.3.1/src/yrcom.egg-info/requires.txt +9 -0
  8. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_hses_client.py +24 -0
  9. yrcom-0.3.0/src/yrcom.egg-info/requires.txt +0 -3
  10. {yrcom-0.3.0 → yrcom-0.3.1}/LICENSE +0 -0
  11. {yrcom-0.3.0 → yrcom-0.3.1}/setup.cfg +0 -0
  12. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/hses_errors.py +0 -0
  13. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/hses_file.py +0 -0
  14. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/hses_server_codec.py +0 -0
  15. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/hses_sim.py +0 -0
  16. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/robot_connection.py +0 -0
  17. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom/yaskawa_client.py +0 -0
  18. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom.egg-info/SOURCES.txt +0 -0
  19. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom.egg-info/dependency_links.txt +0 -0
  20. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom.egg-info/entry_points.txt +0 -0
  21. {yrcom-0.3.0 → yrcom-0.3.1}/src/yrcom.egg-info/top_level.txt +0 -0
  22. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_hses_file.py +0 -0
  23. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_hses_server_codec.py +0 -0
  24. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_hses_sim.py +0 -0
  25. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_robot_connection.py +0 -0
  26. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_yaskawa_client.py +0 -0
  27. {yrcom-0.3.0 → yrcom-0.3.1}/tests/test_yaskawa_commands.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yrcom
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Yaskawa robot communication — Ethernet Server, HSES and HSES File Control (pure stdlib)
5
5
  Author: cmosbk
6
6
  License: MIT
@@ -12,12 +12,21 @@ Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Provides-Extra: dev
14
14
  Requires-Dist: pytest>=8; extra == "dev"
15
+ Provides-Extra: docs
16
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
17
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
18
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
19
+ Requires-Dist: black>=24; extra == "docs"
15
20
  Dynamic: license-file
16
21
 
17
22
  # yrcom
18
23
 
19
24
  [![CI](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml/badge.svg)](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml)
20
25
 
26
+ 📖 **Documentation: <https://cmosbk.github.io/yrcom/>** — getting started, the
27
+ transport guide and the full API reference (every command, generated from the
28
+ source).
29
+
21
30
  Yaskawa robot communication as a standalone Python library — a single,
22
31
  hardware-verified communication core meant to be shared across projects
23
32
  instead of being duplicated.
@@ -2,6 +2,10 @@
2
2
 
3
3
  [![CI](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml/badge.svg)](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml)
4
4
 
5
+ 📖 **Documentation: <https://cmosbk.github.io/yrcom/>** — getting started, the
6
+ transport guide and the full API reference (every command, generated from the
7
+ source).
8
+
5
9
  Yaskawa robot communication as a standalone Python library — a single,
6
10
  hardware-verified communication core meant to be shared across projects
7
11
  instead of being duplicated.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "yrcom"
7
- version = "0.3.0"
7
+ version = "0.3.1"
8
8
  description = "Yaskawa robot communication — Ethernet Server, HSES and HSES File Control (pure stdlib)"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -15,6 +15,7 @@ dependencies = []
15
15
 
16
16
  [project.optional-dependencies]
17
17
  dev = ["pytest>=8"]
18
+ docs = ["mkdocs>=1.6", "mkdocs-material>=9.5", "mkdocstrings[python]>=0.26", "black>=24"]
18
19
 
19
20
  [project.scripts]
20
21
  yrcom-sim = "yrcom.hses_sim:_main"
@@ -40,7 +40,7 @@ from .hses_server_codec import (
40
40
  encode_error,
41
41
  )
42
42
 
43
- __version__ = "0.3.0"
43
+ __version__ = "0.3.1"
44
44
 
45
45
  __all__ = [
46
46
  "YaskawaClient", "VarType", "EthernetServerClient",
@@ -581,6 +581,8 @@ class HsesClient(_HsesSocket):
581
581
  position_group: int = 0,
582
582
  b_vars: "list[dict]" = [],
583
583
  i_vars: "list[dict]" = [],
584
+ d_vars: "list[dict]" = [],
585
+ r_vars: "list[dict]" = [],
584
586
  io_signals: "list[dict]" = [],
585
587
  read_cio: bool = False,
586
588
  ) -> dict:
@@ -590,7 +592,11 @@ class HsesClient(_HsesSocket):
590
592
  alarm_slots: number of alarm history slots (0=skip, max 4)
591
593
  include_job: read executing job info
592
594
  position_group: 0=skip, 1-8=pulse, 101-108=cartesian
593
- b_vars/i_vars: list of {"label": str, "no": int}
595
+ b_vars/i_vars/d_vars/r_vars:
596
+ list of {"label": str, "no": int}. Each becomes one
597
+ request inside the burst, so its value shares the
598
+ instant of the rest of the row rather than arriving a
599
+ round trip later.
594
600
  io_signals: list of {"label": str, "logical": int}
595
601
 
596
602
  Returns flat dict of all decoded fields.
@@ -622,6 +628,14 @@ class HsesClient(_HsesSocket):
622
628
  reqs.append((_CMD_I_VAR, v["no"], 1, _SVC_GET_SINGLE, b""))
623
629
  tags.append(f"i_var:{v['label']}")
624
630
 
631
+ for v in d_vars:
632
+ reqs.append((_CMD_D_VAR, v["no"], 1, _SVC_GET_SINGLE, b""))
633
+ tags.append(f"d_var:{v['label']}")
634
+
635
+ for v in r_vars:
636
+ reqs.append((_CMD_R_VAR, v["no"], 1, _SVC_GET_SINGLE, b""))
637
+ tags.append(f"r_var:{v['label']}")
638
+
625
639
  # CIO counter: low byte at logical 72000 (inst 7200), high byte at 72010 (inst 7201)
626
640
  if read_cio:
627
641
  reqs.append((_CMD_IO_PLURAL, 7200, 0, _SVC_READ_ALL, struct.pack("<I", 2)))
@@ -666,6 +680,12 @@ class HsesClient(_HsesSocket):
666
680
  elif tag.startswith("i_var:"):
667
681
  if resp.status == 0 and len(resp.data) >= 2:
668
682
  out[f"var_{tag[6:]}"] = struct.unpack_from("<h", resp.data, 0)[0]
683
+ elif tag.startswith("d_var:"):
684
+ if resp.status == 0 and len(resp.data) >= 4:
685
+ out[f"var_{tag[6:]}"] = struct.unpack_from("<i", resp.data, 0)[0]
686
+ elif tag.startswith("r_var:"):
687
+ if resp.status == 0 and len(resp.data) >= 4:
688
+ out[f"var_{tag[6:]}"] = struct.unpack_from("<f", resp.data, 0)[0]
669
689
  elif tag == "cio":
670
690
  if resp.status == 0 and len(resp.data) >= 6:
671
691
  # response: 4-byte count + 2 data bytes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: yrcom
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Yaskawa robot communication — Ethernet Server, HSES and HSES File Control (pure stdlib)
5
5
  Author: cmosbk
6
6
  License: MIT
@@ -12,12 +12,21 @@ Description-Content-Type: text/markdown
12
12
  License-File: LICENSE
13
13
  Provides-Extra: dev
14
14
  Requires-Dist: pytest>=8; extra == "dev"
15
+ Provides-Extra: docs
16
+ Requires-Dist: mkdocs>=1.6; extra == "docs"
17
+ Requires-Dist: mkdocs-material>=9.5; extra == "docs"
18
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == "docs"
19
+ Requires-Dist: black>=24; extra == "docs"
15
20
  Dynamic: license-file
16
21
 
17
22
  # yrcom
18
23
 
19
24
  [![CI](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml/badge.svg)](https://github.com/CMOSBK/yrcom/actions/workflows/ci.yml)
20
25
 
26
+ 📖 **Documentation: <https://cmosbk.github.io/yrcom/>** — getting started, the
27
+ transport guide and the full API reference (every command, generated from the
28
+ source).
29
+
21
30
  Yaskawa robot communication as a standalone Python library — a single,
22
31
  hardware-verified communication core meant to be shared across projects
23
32
  instead of being duplicated.
@@ -0,0 +1,9 @@
1
+
2
+ [dev]
3
+ pytest>=8
4
+
5
+ [docs]
6
+ mkdocs>=1.6
7
+ mkdocs-material>=9.5
8
+ mkdocstrings[python]>=0.26
9
+ black>=24
@@ -624,6 +624,30 @@ def test_poll_all_status_and_job():
624
624
  assert out["job_name"] == "MASTER"
625
625
 
626
626
 
627
+ def test_poll_all_reads_every_variable_kind_in_one_burst():
628
+ """D and R used to be reachable only as standalone reads, which put their
629
+ value a round trip away from the rest of the row."""
630
+ status_data = struct.pack("<II", 0x40, 0x40)
631
+ c, _ = _client([
632
+ _reply(hc._CMD_STATUS, status_data, req_id=1),
633
+ _reply(hc._CMD_B_VAR, struct.pack("<B", 7), req_id=2),
634
+ _reply(hc._CMD_I_VAR, struct.pack("<h", -3), req_id=3),
635
+ _reply(hc._CMD_D_VAR, struct.pack("<i", -70000), req_id=4),
636
+ _reply(hc._CMD_R_VAR, struct.pack("<f", 1.5), req_id=5),
637
+ ])
638
+ out = c.poll_all(
639
+ include_job=False,
640
+ b_vars=[{"label": "b", "no": 1}],
641
+ i_vars=[{"label": "i", "no": 2}],
642
+ d_vars=[{"label": "d", "no": 3}],
643
+ r_vars=[{"label": "r", "no": 4}],
644
+ )
645
+ assert out["var_b"] == 7
646
+ assert out["var_i"] == -3
647
+ assert out["var_d"] == -70000 # signed 32-bit, beyond an I variable
648
+ assert out["var_r"] == pytest.approx(1.5)
649
+
650
+
627
651
  def test_poll_all_raises_on_status_error():
628
652
  c, _ = _client([_reply(hc._CMD_STATUS, b"", req_id=1, status=0x08)])
629
653
  with pytest.raises(HsesError):
@@ -1,3 +0,0 @@
1
-
2
- [dev]
3
- pytest>=8
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes