diff --git a/ebpfcat/ethercat.py b/ebpfcat/ethercat.py index c02d1af81e18b68d1633916ba7fe9020cd73d984..96743488d7bb24eb369773a3c04f4a0c92a57086 100644 --- a/ebpfcat/ethercat.py +++ b/ebpfcat/ethercat.py @@ -401,7 +401,7 @@ class Terminal: self.eeprom = await self.read_eeprom() if 41 not in self.eeprom: - print('no 41 in eeprom') + # no sync managers defined in eeprom return await self.write(0x800, data=0x80) # empty out sync manager await self.write(0x800, data=self.eeprom[41]) diff --git a/ebpfcat/scripts.py b/ebpfcat/scripts.py index 7025076d7a413f2d6ff3f078c374583395382f8a..5b0ee2cbaa6afb831ae41cc459c074197a949a27 100644 --- a/ebpfcat/scripts.py +++ b/ebpfcat/scripts.py @@ -34,6 +34,7 @@ async def info(): parser.add_argument("-n", "--names", action="store_true") parser.add_argument("-s", "--sdo", action="store_true") parser.add_argument("-v", "--values", action="store_true") + parser.add_argument("-p", "--pdo", action="store_true") args = parser.parse_args() ec = EtherCat(args.interface) @@ -42,7 +43,9 @@ async def info(): if args.terminal is None: terminals = range(await ec.count()) else: -# print(await ec.roundtrip(ECCmd.FPRW, 7, 0x10, "H", 0)) + # former terminal: don't listen! + # this does not work with all terminals, dunno why + await ec.roundtrip(ECCmd.FPRW, 7, 0x10, "H", 0) terminals = [args.terminal] terms = [Terminal() for t in terminals] @@ -76,3 +79,5 @@ async def info(): print(f" {r:10} {r:8X}") else: print(f" {r}") + if args.pdo: + t.parse_pdos()