--- a/objdictgen/eds_utils.py Thu Jun 26 11:38:59 2008 +0200
+++ b/objdictgen/eds_utils.py Sat Jun 28 18:43:15 2008 +0200
@@ -516,6 +516,14 @@
optionals = []
manufacturers = []
+ # Remove all unused PDO
+ for entry in entries[:]:
+ if 0x1600 <= entry < 0x1800 or 0x1A00 <= entry < 0x1C00:
+ subentry_value = Node.GetEntry(entry, 1)
+ if subentry_value is None or subentry_value == 0:
+ entries.remove(entry)
+ entries.remove(entry - 0x200)
+
# For each entry, we generate the entry section or sections if there is subindexes
for entry in entries:
# Extract infos and values for the entry
--- a/objdictgen/nodemanager.py Thu Jun 26 11:38:59 2008 +0200
+++ b/objdictgen/nodemanager.py Sat Jun 28 18:43:15 2008 +0200
@@ -200,6 +200,7 @@
self.CurrentNode.SetNodeType(type)
self.CurrentNode.SetNodeDescription(description)
AddIndexList = self.GetMandatoryIndexes()
+ AddSubIndexList = []
if NMT == "NodeGuarding":
AddIndexList.extend([0x100C, 0x100D])
elif NMT == "Heartbeat":
@@ -227,12 +228,22 @@
AddIndexList.extend([0x1021, 0x1022])
if type == "slave":
# add default SDO server
- AddIndexList.extend([0x1280])
+ AddIndexList.append(0x1200)
+ # add default 4 receive and 4 transmit PDO
+ for comm, mapping in [(0x1400, 0x1600),(0x1800, 0x1A00)]:
+ firstparamindex = self.GetLineFromIndex(comm)
+ firstmappingindex = self.GetLineFromIndex(mapping)
+ AddIndexList.extend(range(firstparamindex, firstparamindex + 4))
+ for idx in range(firstmappingindex, firstmappingindex + 4):
+ AddIndexList.append(idx)
+ AddSubIndexList.append((idx, 8))
# Add a new buffer
index = self.AddNodeBuffer(self.CurrentNode.Copy(), False)
self.SetCurrentFilePath("")
# Add Mandatory indexes
self.ManageEntriesOfCurrent(AddIndexList, [])
+ for idx, num in AddSubIndexList:
+ self.AddSubentriesToCurrent(idx, num)
return index
else:
return result