--- a/plugger.py Sat Dec 12 20:51:56 2009 +0100
+++ b/plugger.py Mon Dec 14 11:03:59 2009 +0100
@@ -1340,7 +1340,7 @@
"for_each_variable_do_code":"\n".join([
{"EXT":" (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
"IN":" (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
- "OUT":" (*fp)((void*)&%(C_path)s,%(type)s_P_ENUM);\n",
+ "OUT":" (*fp)((void*)&%(C_path)s,%(type)s_O_ENUM);\n",
"VAR":" (*fp)((void*)&%(C_path)s,%(type)s_ENUM);\n"}[v["vartype"]]%v
for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypes ]),
"find_variable_case_code":"\n".join([
@@ -1348,7 +1348,7 @@
" *varp = (void*)&%(C_path)s;\n"%v+
{"EXT":" return %(type)s_P_ENUM;\n",
"IN":" return %(type)s_P_ENUM;\n",
- "OUT":" return %(type)s_P_ENUM;\n",
+ "OUT":" return %(type)s_O_ENUM;\n",
"VAR":" return %(type)s_ENUM;\n"}[v["vartype"]]%v
for v in self._VariablesList if v["vartype"] != "FB" and v["type"] in DebugTypes ])}
--- a/targets/plc_debug.c Sat Dec 12 20:51:56 2009 +0100
+++ b/targets/plc_debug.c Mon Dec 14 11:03:59 2009 +0100
@@ -64,6 +64,7 @@
#define __BufferDebugDataIterator_case_p(TYPENAME)\
case TYPENAME##_P_ENUM :\
+ case TYPENAME##_O_ENUM :\
*flags = ((__IEC_##TYPENAME##_p *)varp)->flags;\
if (*flags & __IEC_FORCE_FLAG)\
*ptrvalue = &((__IEC_##TYPENAME##_p *)varp)->fvalue;\
@@ -227,6 +228,12 @@
((__IEC_##TYPENAME##_p *)varp)->flags |= flags;\
if(force)\
((__IEC_##TYPENAME##_p *)varp)->fvalue = *((TYPENAME *)force);\
+ break;\
+ case TYPENAME##_O_ENUM :\
+ ((__IEC_##TYPENAME##_p *)varp)->flags |= flags;\
+ if(force)\
+ ((__IEC_##TYPENAME##_p *)varp)->fvalue = *((TYPENAME *)force);\
+ *(((__IEC_##TYPENAME##_p *)varp)->value) = *((TYPENAME *)force);\
break;
void RegisterDebugVariable(int idx, void* force)
{