Bug on bit locations generation fixed
authorlbessard
Fri, 05 Oct 2007 17:51:55 +0200
changeset 61 a20fb174f46e
parent 60 e9667bec7f00
child 62 ddf0cdd71558
Bug on bit locations generation fixed
plugins/canfestival/config_utils.py
--- a/plugins/canfestival/config_utils.py	Tue Oct 02 18:05:36 2007 +0200
+++ b/plugins/canfestival/config_utils.py	Fri Oct 05 17:51:55 2007 +0200
@@ -364,14 +364,14 @@
                 # If a PDO mappable
                 if subentry_infos and subentry_infos["pdo"]:
                     if sizelocation == "X" and len(loc) > 3:
-                        numbit = loc[4]
+                        numbit = loc[3]
                     elif sizelocation != "X" and len(loc) > 3:
                         raise ValueError, "Cannot set bit offset for non bool '%s' variable (ID:%d,Idx:%x,sIdx:%x))" % (name,nodeid,index,subindex)
                     else:
                         numbit = None
                     
                     entryinfos = node.GetSubentryInfos(index, subindex)
-                    if entryinfos["type"] != COlocationtype:
+                    if location["IEC_TYPE"] != "BOOL" and entryinfos["type"] != COlocationtype:
                         raise ValueError, "Invalid type \"%s\"-> %d != %d  for location\"%s\"" % (location["IEC_TYPE"], COlocationtype, entryinfos["type"] , name)
                     
                     typeinfos = node.GetEntryInfos(COlocationtype)
@@ -431,7 +431,7 @@
         #-------------------------------------------------------------------------------
         
         for nodeid, locations in self.LocationsNotMapped.items():
-            node = nodelist.SlaveNodes[nodeid]["Node"]
+            node = self.NodeList.SlaveNodes[nodeid]["Node"]
             
             # Initialize number of params and data to add to node DCF
             nbparams = 0