diff --git a/ebpfcat/ebpfcat.py b/ebpfcat/ebpfcat.py index ce21c6ec5681270b7d87c3cd5affba568ab8b45c..f6dcc7502ccc6f5723186995d5a5d2a85e144c01 100644 --- a/ebpfcat/ebpfcat.py +++ b/ebpfcat/ebpfcat.py @@ -220,9 +220,8 @@ class EBPFTerminal(Terminal): if (self.compatibility is not None and (self.vendorId, self.productCode) not in self.compatibility): raise RuntimeError( - f"Incompatible Terminal: {self.vendorId}:{self.productCode} " - f"({relative}, {absolute})") - await self.to_operational(4) + f"Incompatible Terminal: {self.vendorId}:{self.productCode}") + await self.to_operational(2) self.pdos = {} if self.has_mailbox(): await self.parse_pdos() diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py index 1e0b5570ba47735e8f142e69880d19b9808af8d1..e21e8679c5972974a9221129b7aa199318df5f0f 100644 --- a/ebpfcat/ethercat.py +++ b/ebpfcat/ethercat.py @@ -559,7 +559,7 @@ class Terminal: 0x0130, "H2xH") if error != 0: raise EtherCatError(f"AL register {error}") - if state == target: + if state >= target: return async def get_error(self): diff --git a/ebpfcat/scripts.py b/ebpfcat/scripts.py index 09f9efe1c9d7f4058fb02689c8f174c51a6cc699..3663ced04a66496cfbacf836e1357351298afc15 100644 --- a/ebpfcat/scripts.py +++ b/ebpfcat/scripts.py @@ -74,7 +74,7 @@ async def info(): print(f"{k:2}: {v}\n {v.hex()}") if args.sdo: - await t.to_operational(4) + await t.to_operational(2) ret = await t.read_ODlist() for k, v in ret.items(): print(f"{k:X}:") @@ -91,7 +91,7 @@ async def info(): else: print(f" {r}") if args.pdo: - await t.to_operational(4) + await t.to_operational(2) await t.parse_pdos() for (idx, subidx), (sm, pos, fmt) in t.pdos.items(): print(f"{idx:4X}:{subidx:02X} {sm} {pos} {fmt}") @@ -164,7 +164,7 @@ async def create_test(): await t.initialize(-i, await ec.find_free_address()) sdo = {} if t.has_mailbox(): - await t.to_operational(4) + await t.to_operational(2) odlist = await t.read_ODlist() for k, v in odlist.items():