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

incorporate quirks needed for Bronkhorst controllers

parent ebf9880a
No related branches found
No related tags found
No related merge requests found
...@@ -714,7 +714,7 @@ class Terminal: ...@@ -714,7 +714,7 @@ class Terminal:
print(f"expected CoE package, got {type}") print(f"expected CoE package, got {type}")
coecmd, rodcmd, fragments = unpack("<HBxH", data[:6]) coecmd, rodcmd, fragments = unpack("<HBxH", data[:6])
if rodcmd & 0x7f != odcmd.value + 1: if rodcmd & 0x7f != odcmd.value + 1:
raise EtherCatError(f"expected {odcmd.value}, got {odcmd}") raise EtherCatError(f"expected {odcmd.value}, got {rodcmd}")
ret.append(data[offset:]) ret.append(data[offset:])
offset = 6 offset = 6
return b"".join(ret) return b"".join(ret)
...@@ -849,11 +849,15 @@ class Terminal: ...@@ -849,11 +849,15 @@ class Terminal:
for od in ret.values(): for od in ret.values():
od.entries = {} od.entries = {}
for i in range(1 if od.maxSub > 0 else 0, od.maxSub + 1): for i in range(1 if od.maxSub > 0 else 0, od.maxSub + 1):
data = await self.coe_request(CoECmd.SDOINFO, ODCmd.OE_REQ, try:
"HBB", od.index, i, 7) data = await self.coe_request(CoECmd.SDOINFO, ODCmd.OE_REQ,
"HBB", od.index, i, 7)
except EtherCatError as e:
print(f"problems reading SDO {od.index:x}:{i:x}:", e)
continue
oe = ObjectEntry(od) oe = ObjectEntry(od)
oe.valueInfo, dataType, oe.bitLength, oe.objectAccess = \ oe.valueInfo, dataType, oe.bitLength, oe.objectAccess = \
unpack("<HHHH", data[:8]) unpack("<BxHHH", data[:8])
if dataType == 0: if dataType == 0:
continue continue
assert i == oe.valueInfo assert i == oe.valueInfo
......
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