Skip to content
Snippets Groups Projects
Commit 34bb022c authored by Martin Teichmann's avatar Martin Teichmann
Browse files

add parsing PDOs to ec-info

parent 15103739
No related branches found
No related tags found
No related merge requests found
......@@ -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])
......
......@@ -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()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment