Skip to content
Snippets Groups Projects
Commit 94d8a79a authored by Martin Teichmann's avatar Martin Teichmann Committed by Martin Teichmann
Browse files

ignore Ethernet-over-Ethercat

somehow the anybus thing wants to return a EoE frame when
asked for a CoE frame. We can just ignore it, then it works
fine.
parent 88ab68e8
No related branches found
No related tags found
2 merge requests!9support Leybold turbo pump,!8Draft: move the index field to the end of packet
......@@ -664,9 +664,11 @@ class Terminal:
offset = 8 # skip header in first packet
while fragments:
type, data = await self.mbx_recv()
if type is not MBXType.COE:
raise EtherCatError(f"expected CoE package, got {type}")
type = None
while type is not MBXType.COE:
type, data = await self.mbx_recv()
if type is not MBXType.COE:
print(f"expected CoE package, got {type}")
coecmd, rodcmd, fragments = unpack("<HBxH", data[:6])
if rodcmd & 0x7f != odcmd.value + 1:
raise EtherCatError(f"expected {odcmd.value}, got {odcmd}")
......@@ -681,9 +683,11 @@ class Terminal:
ODCmd.UP_REQ_CA.value if subindex is None
else ODCmd.UP_REQ.value,
index, 1 if subindex is None else subindex)
type, data = await self.mbx_recv()
if type is not MBXType.COE:
raise EtherCatError(f"expected CoE, got {type}")
type = None
while type is not MBXType.COE:
type, data = await self.mbx_recv()
if type is not MBXType.COE:
print(f"got {type}")
coecmd, sdocmd, idx, subidx, size = unpack("<HBHBI", data[:10])
if coecmd >> 12 != CoECmd.SDORES.value:
if subindex is None and coecmd >> 12 == CoECmd.SDOREQ.value:
......
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