# HG changeset patch # User Edouard Tisserant # Date 1350946590 -7200 # Node ID bb59865db6e631f1fd074a45e022c1c91ad49674 # Parent 980800a5aad0c139c370bcecccf7cae6b4c3f6c1 Introduced FBID in tests/python example. Fixed type error leading to segfault diff -r 980800a5aad0 -r bb59865db6e6 tests/python/c_code@c_ext/cfile.xml --- a/tests/python/c_code@c_ext/cfile.xml Fri Oct 19 12:14:24 2012 +0200 +++ b/tests/python/c_code@c_ext/cfile.xml Tue Oct 23 00:56:30 2012 +0200 @@ -15,7 +15,7 @@ return val+1; } -int Python_to_C_Call(int toC, int *fromC){ +int Python_to_C_Call(char toC, char *fromC){ /* Code called by python should never touch to variables modified by PLC thread directly @@ -33,7 +33,7 @@ return res; } -int PLC_C_Call(int fromPLC, int *toPLC){ +int PLC_C_Call(char fromPLC, char *toPLC){ /* PLC also have to be realy carefull not to conflict with asynchronous python access */ int res; diff -r 980800a5aad0 -r bb59865db6e6 tests/python/plc.xml --- a/tests/python/plc.xml Fri Oct 19 12:14:24 2012 +0200 +++ b/tests/python/plc.xml Tue Oct 23 00:56:30 2012 +0200 @@ -8,7 +8,7 @@ productVersion="0.0" creationDateTime="2008-12-14T16:21:19"/> + modificationDateTime="2012-10-23T00:54:38"> @@ -114,21 +114,21 @@ - + 'time.sleep(1)' - + - - + + @@ -138,8 +138,8 @@ - - + + @@ -241,10 +241,10 @@ - 'sys.stdout.write("1234\n")' + 'sys.stdout.write("FBID :"+str(FBID)+"\n")' - + @@ -269,7 +269,7 @@ - + @@ -357,8 +357,8 @@ - - + + @@ -422,14 +422,14 @@ pytest_var1 - + - - + + @@ -437,8 +437,8 @@ - - + + @@ -446,8 +446,8 @@ - - + + @@ -457,8 +457,8 @@ - - + + @@ -468,8 +468,8 @@ - - + + @@ -486,19 +486,19 @@ - + 3 - + - - + + pytest_var3 @@ -586,6 +586,30 @@ Enjoy. ]]> + + + + + + + + + + + + + + + + + + + + + + + + diff -r 980800a5aad0 -r bb59865db6e6 tests/python/python@py_ext/py_ext.xml --- a/tests/python/python@py_ext/py_ext.xml Fri Oct 19 12:14:24 2012 +0200 +++ b/tests/python/python@py_ext/py_ext.xml Tue Oct 23 00:56:30 2012 +0200 @@ -9,7 +9,7 @@ i = ctypes.c_int() if(Python_to_C_Call(arg, i)): res = i.value - print "toC:", arg, "from C:", res + print "toC:", arg, "from C:", res, "FBID:", FBID else: print "Failed Python_to_C_Call failed" res = None