Adding standard default value to index 0x1014
authorlbessard
Mon, 12 Nov 2007 13:24:17 +0100
changeset 313 fed411af774a
parent 312 70f96abd8ecd
child 314 68e83c3ffbb5
Adding standard default value to index 0x1014
objdictgen/gen_cfile.py
objdictgen/node.py
--- a/objdictgen/gen_cfile.py	Wed Nov 07 07:46:14 2007 +0100
+++ b/objdictgen/gen_cfile.py	Mon Nov 12 13:24:17 2007 +0100
@@ -109,7 +109,7 @@
     strSwitch = """    case valueRange_EMC:
       if (*(UNS8*)value != (UNS8)0) return OD_VALUE_RANGE_EXCEEDED;
       break;\n"""
-    internal_types["valueRange_EMC"] = ("UNS8", "", "valueRange_EMC")
+    internal_types["valueRange_EMC"] = ("UNS8", "", "valueRange_EMC", True)
     num = 0
     for index in rangelist:
         rangename = Node.GetEntryName(index)
@@ -124,7 +124,7 @@
             maxvalue = Node.GetEntry(index, 3)
             strDefine += "\n#define valueRange_%d 0x%02X /* Type %s, %s < value < %s */"%(num,index,typeinfos[0],str(minvalue),str(maxvalue))
             strSwitch += "    case valueRange_%d:\n"%(num)
-            if typeinfos[4] and minvalue <= 0:
+            if typeinfos[3] and minvalue <= 0:
                 strSwitch += "      /* Negative or null low limit ignored because of unsigned type */;\n"
             else:
                 strSwitch += "      if (*(%s*)value < (%s)%s) return OD_VALUE_TOO_LOW;\n"%(typeinfos[0],typeinfos[0],str(minvalue))
--- a/objdictgen/node.py	Wed Nov 07 07:46:14 2007 +0100
+++ b/objdictgen/node.py	Mon Nov 12 13:24:17 2007 +0100
@@ -140,7 +140,7 @@
     0x1013 : {"name" : "High Resolution Timestamp", "struct" : var, "need" : False, "values" :
                 [{"name" : "High Resolution Time Stamp", "type" : 0x07, "access" : 'rw', "pdo" : True}]},
     0x1014 : {"name" : "Emergency COB ID", "struct" : var, "need" : False, "values" :
-                [{"name" : "Emergency COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False}]},
+                [{"name" : "Emergency COB ID", "type" : 0x07, "access" : 'rw', "pdo" : False, "default" : "\"$NODEID+0x80\""}]},
     0x1015 : {"name" : "Inhibit Time Emergency", "struct" : var, "need" : False, "values" :
                 [{"name" : "Inhibit Time Emergency", "type" : 0x06, "access" : 'rw', "pdo" : False}]},
     0x1016 : {"name" : "Consumer Heartbeat Time", "struct" : rec, "need" : False, "values" :